I recently wanted to use Mac OS X Personal Web Sharing on my computer (to test webpages on my iPod Touch across the local network). I hadn’t used Web Sharing for a long time, as I use MAMP for most of my local-web-server-testing needs these days. Unfortunately, getting Web Sharing running wasn’t to be just one-click away…
After enabling “Web Sharing” in System Preferences, I opened the URL for “Your computer’s website” in Safari and received a “Safari can’t find the server” message.
After a bit of troubleshooting, the httpd.conf file certainly wasn’t the culprit—it was exactly the same as the httpd.conf file on another Mac where Web Sharing worked successfully.
It was Console (/Applications/Utilites/Console.app) that identified the problem. Among several Apache error messages was the following:
(2)No such file or directory: httpd: could not open error log file /private/var/log/apache2/error_log. Unable to open logs.
For some reason, the apache2 folder was missing in /private/var/log/, and as a result, the Apache web server never started. Safari couldn’t access the page because the web server wasn’t running!
The solution was to simply create the folder apache2 in /private/var/log/.
