Default Apache Site
How can I control the default site directory if only IP is entered? I'd like the default page within /var/www/html to open. This is a CentOS 5.3 installation.
Some settings I have are like this:
DocumentRoot "/var/www/html"
NameVirtualHost *:80
DocumentRoot /var/www/website1
ServerName
ServerAlias website1.com
ErrorLog logs/website1-error.log
CustomLog logs/website1-access.log common
DocumentRoot /var/www/website2
ServerName
ServerAlias website2.com
ErrorLog logs/website2-error.log
CustomLog logs/website2-access.log common
3 Replies
Using default vhosts
You're not using per-IP VirtualHosts. default would work then, yes.
You're using NameVirtualHosts.
And in these, the first entry for the IP in question (or the *:80 wildcard, of course) is the one that's used if no ServerName or ServerAlias names equal the Host: header.
TL;DR: With NameVirtualHosts, first