Homebrew Apache Not Responding

Penned 11 months ago. It will take about 1:44 to read.
It was 72°F in San Diego, CA with a few clouds.

"Check your ownership friends. Check your ownership."

So, if you are a homebrew using fool like me, and have recently found that your apache install isn't working after a reboot, then this might be the article for you. I had this very problem this morning and after a little digging I discovered it was a permissions issue on a log file, of all things.

This might only be an issue for those of us who have set up SSL on our local machines, but I mean, that should be all of us, since we should be deploying all of our sites as SSL, and we need to make sure everything works as expected, right? RIGHT?

Anywhoo, the issue I found was that when I rebooted the machine the ownership of the ssl_request_log file was changed to root, which rendered it unreadable to apache during its startup sequence. A quick change of ownership to the correct account and group fixed the problem. I was able to restart apache with the homebrew services command and everything worked as expected.

If you aren't familiar with navigating things via the command line, follow these simple steps:

  1. Open a terminal window, type cd /usr/local/var/log/httpd and hit enter.
  2. Next type ls -la to get a listing of all the files in the current directory.
  3. You should see 3 files: access_log, error_log and the aforementioned ssl_request_log.
  4. Check the ownership on these files. They should all match. The two columsn with names in them are your ownership settings, something like johnsmith admin.
  5. If you see something else, like root admin that is probably your problem. We need to change that to match the other two files.

To do this, you need to use the chown command, like so:

sudo chown johnsmith:admin ssl_request_log

You'll be asked for a password, which is your account password for your mac, and then hopefully everything is fixed! To test, simply type in:

homebrew services restart httpd

And then reload your local project in your browser of choice. Hopefully that helps someone out there!

Further Reading

When in Doubt, Buff it Out.

Thanks for checking out the site, be sure to come back for more.