|
|
|
<?php
// *******************************************************************
//
// Apache Virtual Host Lister
//
// *******************************************************************
//
// If you have an ever growing list of virtual hosts in your httpd.conf
// you may find this script useful as a default homepage.
//
// Name this file index.php and use it to replace the index.html file
// in the docroot of your Apache installation,
// Unix: /usr/local/apache/htdocs
// Windows: C:\Program Files\Apache Group\Apache\htdocs
// load httpd.conf file into variable
$conf_file = implode("", file("../conf/httpd.conf"));
// extract virtual hosts from file contents
eregi("Listen localhost:80(.*)# VirtualHost:", $conf_file, $result);
// remove 'listen' from string
$edited_result = ereg_replace("Listen ", "", $result[1]);
// put result back into an array
$array_result = explode("\n", $edited_result);
// print to screen
echo "<h3>" . (getenv("SERVER_SOFTWARE")) . "</h3>";
while(list($key, $value) = each($array_result)) {
echo "<a href=\"http://$value\">$value</a><br>";
}
?> |
|
| Caldera Openlinux 1.2 Standard Categories : Web Servers, MySQL, PHP, Apache, Databases | | | apache_lookup_uri -- Perform a partial request for the specified URI and return all info about it Categories : PHP, PHP Functions, Apache, Web Servers | | | include php3 files Categories : Filesystem, PHP, Apache, Web Servers | | | Easy windows installation kit for win 9* PHP4 MySQL Apache phpMyAdmin Categories : Installation, PHP, MySQL, Apache, Web Servers | | | PHP Apache and SSL Categories : PHP, Apache, Web Servers | | | Logging 404 errors in your custom statistics using Apache and a PHP script. Categories : Apache, Web Servers, PHP, Errors and Logging | | | Why do i get a "Save As" dialog box when I type in the url of a php3 file Categories : PHP Configuration, PHP, Apache, Web Servers | | | gd libraries make gmake php3 apache-1.3.0 gd1.3 FreeBSD-2.2
Categories : Installation, PHP, Apache, Web Servers | | | WebServerSpy checks which kind of Webserver is running, Apache, Netscape, Fasttrack, IIS, HTTP-Header, HTTP 1.0, GET, spy, WWW Categories : HTTP, Network, Apache, PHP, Web Servers | | | phpCMS a content-management-system written in php. Categories : Content Management, Apache, Complete Programs, Web Servers, PHP | | | uaa Categories : Apache, Apache, Browsers, Calendar | | | PostgreSQL and apache web authentication source.
Categories : Authentication, PostgreSQL, Apache, Web Servers | | | How to use your own 404 Error file from .htaccess. Categories : Apache, Web Servers | | | How do you specify the default document in Apache?
Categories : Apache, HTTP, Web Servers | | | PHP Based Apache + Mysql Error Log Parser Categories : PHP, PHP Classes, Apache, MySQL, Log Files | |
| | | | Demian Turner wrote :720
This script is explained in more detail at http://www.phpkitchen.com/article.php?story=20010703140116170
| |
|
|