0

I've followed instruction on how to activate Apache on my Mac prior to upgrading to Sierra. I got the "It Works" page after entering localhost in the address field, yet after I upgraded to Sierra, I got the "This site cannot be reached" page.

All of my (Google) searches say to to deactivate Apache with this:

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

but, when I use that, this is returned:

/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service

I have tried:

sudo achapectl stop, 

but receive:

sudo: achapectl: command not found

Can someone help!?

  • 2
    the command is apachectl not achapectl – Gio Valerio Feb 22 '18 at 21:56
  • I was encountering the same issue when trying to unload with launchctl and /usr/sbin/httpd -k stop wasn't helping either as it would automatically restart immediately. Unable to find what was starting it, I purposefully put a syntax error in /etc/apache2/httpd.conf and used kill to stop the running process. Certainly not an elegant solution, but I was under a time crunch and didn't have the freedom to track down at the time what the root cause of apache restarting itself. – Darren Felton Mar 29 '18 at 19:24
1

If you try to (force-)unload a system daemon or agent which isn't actually loaded or running you will get the displayed error:

...: Could not find specified service

So first check if the daemon is running (example Apache):

sudo launchctl list | grep apache

If it's running unload it:

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

As mentioned by the user Gio Valerio, the proper command to start/stop Apache is:

sudo apachectl start|stop
  • should be sudo launchctl list | grep apache make sure you're not making a typo, otherwise it will always be command not found – lokers Feb 9 at 19:31

You must log in to answer this question.

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