OS X – Apache Web Sharing Starts But You Are Unable Connect

In an effort to save you an afternoon of searching, I thought I would post this to help the OS X users having this issue. There are the usual causes of no content in the web root, firewall blocking requests, incorrect permissions and/or httpd.conf syntax errors. The one error that is a little tougher to track down is apache not being able to create log files. Check the line in the httpd.conf file that shows the path to apache’s log file. It should look something like this:

ErrorLog “/private/var/log/apache2/error_log”

Now if the directory apache2 does not exist in /private/var/log/, apache will fail to start without giving you much of an error message. To correct this, in terminal type:

sudo mkdir /private/var/log/apache2

Enter your admin password and restart apache either in System Preferences=>Sharing=>Web Sharing or in terminal by typing:

 sudo apachectl restart

Once this is done, enter your web address in the web browser and you should see your pages load. Hope this helps!

Tags: , , ,

2 Responses to “OS X – Apache Web Sharing Starts But You Are Unable Connect”

  1. Andy June 1, 2011 at 6:40 pm #

    THANK YOU SO MUCH! I tried so many things and I felt stupid but that was a pretty obscure error so I don’t feel so bad now

    • safety June 1, 2011 at 7:03 pm #

      Glad that we could help you out! I wrestled with this one for quite some time one day before finding the issue. Let me know if you run into anymore problems and thanks for stopping by!

Leave a Reply