I'm struggling with getting Virtual Hosts running on my local Lion development machine.
Here's the scenario. I have Site-A.dev and Site-B.dev sitting in my
User/computername/Sites folder, like this:
/etc/apache2/extra/httpd-vhosts.conf file has the following entries:
#<VirtualHost *:80> # DocumentRoot /Users/computername/Sites/Site-A.com # ServerName project.Site-A.dev #</VirtualHost> <VirtualHost *:80> DocumentRoot /Users/computername/Sites/Site-B.com ServerName project.Site-B.dev </VirtualHost>
etc/hosts file looks like:
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost #127.0.0.1 project.Site-A.dev 127.0.0.1 project.Site-B.dev
Eventhough all instances of Site-A are commented out, every time I try
http://project.Site-B.dev I get Site-A in the browser! What in the world is going on?
To make matters more confounding, when edit my
/etc/apache2/httpd.conf file to look like this:
# Virtual hosts Include /private/etc/apache2/extra/httpd-vhosts.conf
I get a Server Not Found error!
If I leave it like:
# Virtual hosts #Include /private/etc/apache2/extra/httpd-vhosts.conf
Then all I get is Site-A
What am I missing?
Edit It should be noted that both sites are running PHP