On my Mac OS X, Web Sharing is disabled in System Preferences -> Sharing -> Services -> "Personal Web Sharing". Still, when I type "localhost" in the browser, I get the "It works!" message, meaning that Apache is still running. How do I disable it?
Currently the bundled Apache port 80 is conflicting with my MAMP installation, since I want MAMP to run on 80.
It seems that Apache on 10.8 had decided to become active (perhaps after a minor update). Found that you can run the following command to permanently disable Apple's Apache:
Disabling Web Sharing in System Preferences should disable Apache.
However, make sure that when you load "localhost" in your browser, that you force a refresh rather than your browser loading the cached response from when Apache was running. You can force a refresh by Command-Shift-R in many browsers (as opposed to Command-R for a normal refresh).
Additionally, you can verify that Apache is no longer loaded by running this command in Terminal:
If Apache is loaded, you will see a ps entry for
You could also simply try turning Web Sharing on and then back off. People forget that the interface does not always give you accurate information on the state of the system.
By turning Web Sharing on, you get the opportunity to turn it off and cause the system to do the steps associated with turning it off. Simply looking at the check box and seeing it is unchecked doesn't do that.
To prevent auto-start of apache server, use
This will stop apache server to use port 80, unfortunately after you restart your macOS, Apache Server will summon itself again.
You can reuse above command after restart