MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
April
Sun Mon Tue Wed Thu Fri Sat
     
17
   
2009
Months
Apr


Fri, Apr 17, 2009 8:42 pm

Default Virtualhost in Apache

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:

  1. VirtualHost Examples
    Apache HTTP Server Version 2.0
    The Apache HTTP Server Project

[/network/web/server/apache] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo