Apache Virtual Host query
Dear friends,
This is my httpd.conf NameVirtualHost 192.168.0.6:80 <VirtualHost 192.168.0.6:80> DocumentRoot /var/www/vhosts/project-manager/v1.0 ServerName pm.bnv.local </VirtualHost> <VirtualHost 192.168.0.6:80> DocumentRoot /var/www/vhosts/accounting/v2.0 ServerName accounting.bnv.local </VirtualHost> The issue is when I write 192.168.0.6 in the browser it loads the pm.bnv.local by default. I want to have Apache test page when someone types the IP in the browser. |
I don't think this would be a problem if this was the only site in your conf but since you have multiple virtual hosts, it's going to direct to the default and use the ServerName defined. Why would the name make any difference? Most associate names better than IP Addresses..
|
Another idea (and the one that I use) is to just give the second virtual host a different private IP address. Then there aren't any issues.
|
Add a third virtual host before all others and let that point to the apache testpage. Although it's not guaranteed (as far as I know) that it will use that one, the chances are good that it will use it as the default.
|
Thanks Guys,
Wim your proposed solution worked for me. Thanks for help. |
All times are GMT -5. The time now is 07:42 PM. |