Can't unload native macOS Mojave apache using launchctl
I have a fresh installation of MacOS Mojave 10.14. I'm trying to shutdown and remove auto-loading scripts for apache.
$ httpd -v
Server version: Apache/2.4.34 (Unix)
Server built: Aug 17 2018 16:29:43
$ sudo apachectl stop
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/nullAfter rebooting, I open the browser and go to localhost and still shows "It works!". What should I do to make the OS to stop launching apache on reboot? Am I missing something?
31 Answer
When I run the command … sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist … I receive the following error:
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
Trying to delete the file manually fails, too; so I believe this is protected by SIP. I was able to disable SIP, and the command still didn't work. I just deleted the plist file to keep the process from starting. That's probably NOT the preferred method.