Apache failed to start under OS X Leopard

I love my Mac, but this morning I found the one reason why the glossy UI isn’t always that great – since upgrading to Leopard Apache hasn’t been working on localhost but according to the System Preferences panel all is well.

A quick Google and I found several references to apachectl which is the server control interface. Running “apachectl -k restart” at the prompt returned


(13)Permission denied: make_sock: could not bind to address 10.0.0.1:80
no listening sockets available, shutting down
Unable to open logs

There were 2 clues – the one which I ignored at first about permissions (“i’m logged into an administrative account so it can’t be permissions… doh”), and the reference to the logs. Turns out that on my installation of Leopard the log file folder had failed to be created and thus Apache wasn’t starting.

If you’re having these problems, try the following.

sudo mkdir /private/var/log/apache2
sudo apachectl -k restart

Hey presto everything back under glossy System Preference panel controls once more, and just PHP to get working again.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s