Skip to main content

Homebrew Apache Not Responding

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

To do this, you need to use the <em>chown</em> command, like so:

<em>sudo chown johnsmith:admin ssl_request_log</em>

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:

<em>homebrew services restart httpd</em>

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

Discussion

Login Required

You must be signed in to post to this board.

Registered users only · No anonymous posting

No messages in this thread yet.