Why is my vhosts file interfering with my apache deployment?

Posted by Avery Chan on Server Fault See other posts from Server Fault or by Avery Chan
Published on 2012-06-08T09:16:04Z Indexed on 2012/06/08 10:41 UTC
Read the original article Hit count: 289

Filed under:
|

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)

© Server Fault or respective owner

Related posts about apache2

Related posts about vhosts