The first virtualhost section in Apache's
httpd.conf
file will be used as the default for any domain that doesn't have
its own virtualhost section in the configuration file, if you
use *:80
in the virtualhost section. E.g., suppose
the very first virtualhost listed in httpd.conf
is dummy-host.example.com
as shown below.
<VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot /www/docs/dummy-host.example.com ServerName dummy-host.example.com ErrorLog logs/dummy-host.example.com-error_log CustomLog logs/dummy-host.example.com-access_log common </VirtualHost>
If the IP address for another.example.com
, points to
the same webserver, but there is no virtualhost section for
another.example.com
, then anyone who uses
http://another.example.com will see whatever homepage was set up
for dummy-host.example.com
.
References:
-
VirtualHost Examples
Apache HTTP Server Version 2.0
The Apache HTTP Server Project