Apache2+SSL on OS X

CromeDome on 2007-01-25T16:28:33

I was fighting with Apache2 + mod_ssl on my OS X box for a while, and as it turned out, I was missing something pretty simple that wasn't documented that well anywhere. I'm posting this in hopes that I save others the same frustration.

I built Apache in the following manner:

./configure --prefix=/opt/apache20 --enable-ssl --with-ssl=/opt/local

And when I ran:

sudo /opt/apache20/bin/apachectrl startssl

I got this in my error log:

[Thu Jan 25 09:04:49 2007] [emerg] (13)Permission denied: couldn't grab the accept mutex [Thu Jan 25 09:04:50 2007] [alert] Child 29791 returned a Fatal error... Apache is exiting!

Makes it hard to develop a webapp when your webserver fails to start ;-)

Come to find out that on OS X, using an AcceptMutex of default wasn't good enough. Apparently, OS X wants it set explicitly to flock, ala:

SSLMutex file:/opt/apache20/logs/ssl_mutex AcceptMutex flock

Hope some of you find this helpful.