I recently formatted and installed my iMac. I am running 10.6.5. Prior to this format, I had the default Apache web server up and running with several virtual hosts, and everything ran beautifully. After formatting, I set everything back up again, and now Apache is acting funny. Here is a description of what I have going on.

My default root directory for the Apache Web server is pointed to an external hard drive. In my httpd.conf, here is what I have:

DocumentRoot "/Storage/Sites"

Then a few lines beneath that:

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all

And then beneath that:

<Directory "/Storage/Sites">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from All

At the end of this file, I have commented out the user dir include conf file:

Include /private/etc/apache2/extra/httpd-userdir.conf

And uncommented the virtual hosts conf file:

Include /private/etc/apache2/extra/httpd-vhosts.conf

Moving on, I have the following entry in my vhosts file:

<VirtualHost *:80>
   DocumentRoot "/Storage/Sites/mysite"
   ServerName mysite.dev

I also have a host record in my /etc/hosts file that points mysite.dev to (I also tried using my router IP,

The problem I am coming across is, despite having PHP files in /Storage/Sites/mysite, the server is still looking at /Storage/Sites. I know this because in the DocumentRoot contains a php file with phpinfo() (whereas the index.php file in mysite has different code).

I have tried setting up other virtual hosts, but they are still doing the same thing. Also, "NameVirtualHost *:80" is in my vhosts file. I saw as a solution on another thread here. Doesn't seem to make a difference.

Any ideas on this? Let me know if this is not enough information.


Only include directive options that will be common to all VirtualHosts in your main httpd.conf file. Make all hosts served by Apache virtual.

Remove the DocumentRoot and blocks from your main httpd.conf file. Only have them in the httpd-vhosts.conf file.

| improve this answer | |
  • That didn't seem to work. I ran "sudo httpd" and this error was given: (48)Address already in use: make_sock: could not bind to address [::]:80 – Charles Chadwick Dec 26 '10 at 18:27
  • 1
    Apache is already running. Execute 'sudo apachectl graceful' or disable and re-enable the service under Sharing in the System Preferences. – bahamat Dec 27 '10 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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