0

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)

Son of the Wai-Pan
  • 757
  • 4
  • 11
  • 25

1 Answers1

2

Once you turn on vhosts, you must add localhost as a vhost. See my answer here: Virtual host “Forbidden You don't have permission to access / on this server” on debian

KM.
  • 1,786
  • 2
  • 18
  • 31