I have an issue where Apache will not start on a restart. I have tried commands like

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

to allow Apache to start, but it hangs up and I am unable to reach the site. I get the message

(48)address already in use ah00072  Unable to open logs.  

which tells me that port 80 is in use. When I look at the active processes listening to port 80 I find that it is apache (httpd) is the only process running on 80. So I run

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

to remove apache from the 'automatically' launching at startup, and I am able to run apachectl start without an issue.

The mac is running 10.12.5 Sierra.

  • 1
    Are you running server.app to manage apache or just letting the stock one run? – bmike Oct 31 '17 at 17:59
  • I am using the stock one – Alcyeonnero Oct 31 '17 at 18:05
  • Yes, it is meant to be unload sorry about the typo. – Alcyeonnero Oct 31 '17 at 19:34
  • so when using the correct sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist I am able to start apache without issue, the goal, ultimately is to have Apache start on reboot – Alcyeonnero Oct 31 '17 at 19:35
  • as a workaround, I tried to set up a cron to automatically start apache on a restart, which, unfortunately, did not work either – Alcyeonnero Nov 1 '17 at 17:52

I've had good luck using the homebrew builds to start and stop daemons as they handle the launch preferences well with simply syntax.

brew install apache2
brew services start httpd

A side benefit of having this version is you can patch and upgrade faster than Apple does. The downside is you might need to move your configuration files from the system side to the /usr/local/bin side one time.

If you are running a headless mini - I also am a big fan of using Server.app to make the web service a couple of clicks easy and the server.app also helps with certificate management, gives you Apple Push Notifications and several other useful bundled services.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .