Why is my vhosts file interfering with my apache deployment?
- by Avery Chan
When I enable my vhosts file (i.e. uncomment this line: Include /private/etc/apache2/extra/httpd-vhosts.conf) I am unable to reach localhost. I /am/ able to reach the last virtual host listed in my vhosts file:
<VirtualHost *:80>
DocumentRoot "/Users/achan/Sites/epwbst"
ServerName epwbst
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/achan/Sites/pxproj"
ServerName pxproj
</VirtualHost>
Typing pxproj in my browser brings up the expected web content. But I am unable to reach epwbst or localhost. If I re-comment the vhost line in my httpd.conf, I am able to reach local host (i.e. "It works!") but obviously am unable to reach my virtual hosts. I don't know how to continue troubleshooting this.
Why can't I reach localhost when I've got my vhosts turned on?
OS: Mac OS X 10.7
Server version: Apache/2.2.21 (Unix)