I figured since I was using OS X and it touts being UNIX compliant that for a local web development sandbox, I'd just use a local install of apache instead of a virtualized Linux install. I thought all I had to do was go to System Preferences, go to Sharing, then tick the checkbox next to Web Sharing and I'd be good to go. This is OS X after all, not some complicated Linux install that requires some arcane knowledge to administer.
Didn't work. Got an access denied when I tried to view my localhost. Fan-fail-tastic.
I went to check the access logs, which I assumed were in /var/log/apache2/error.log but there wasn't even a /var/log/apache2 directory to look in. OK, check out /var/log/system.log. Hmm, this stands out:
No such file or directory: httpd: could not open error log file /usr/logs/error_log
A quick search yields the solution, you need to do a sudo mkdir -p /var/log/apache2 first and make sure the error log is set to log there. (I'm not sure why so many paths are prefixed with /private
While the config file isn't how I'm used to seeing things and the entire a2ensite and a2dissite thing doesn't work this way, it does work. Though I find it really interesting that in the modern Linux distros that I've used, apache worked out of the box, but under OS X, it doesn't.
Onward.
Post new comment