Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm struggling with getting Virtual Hosts running on my local Lion development machine.

Here's the scenario. I have and sitting in my User/computername/Sites folder, like this: User/computername/Sites/ User/computername/Sites/

My /etc/apache2/extra/httpd-vhosts.conf file has the following entries:

#<VirtualHost *:80>
#       DocumentRoot /Users/computername/Sites/
#       ServerName
<VirtualHost *:80>
        DocumentRoot /Users/computername/Sites/

And my 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.
##       localhost broadcasthost
::1             localhost
fe80::1%lo0     localhost


Eventhough all instances of Site-A are commented out, every time I try 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

share|improve this question

After running httpd -S I discovered that the location of my httpd-vhosts.conf file had been moved to /private/etc/apache2/other/httpd-vhosts.conf.

Heres what the httpd -S reported:

[Tue Feb 07 12:51:37 2012] [warn] module php5_module is already loaded, skipping
httpd: Could not reliably determine the server's fully qualified domain name, using macshortname.local for ServerName
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server (/private/etc/apache2/other/httpd-vhosts.conf:17)
         port 80 namevhost (/private/etc/apache2/other/httpd-vhosts.conf:17)
         port 80 namevhost localhost (/private/etc/apache2/other/httpd-vhosts.conf:36)
Syntax OK

Once I discovered that I was editing the wrong httpd-vhosts.conf file I was able to fix the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.