I have several instances of httpd running on my Mac. Don't need to run a web server, would like to end them all, as they add up to about 100mb of unnessecary RAM. What is the configuration that sets them to run? How can I disable it?
3 Answers
Mountain Lion removed the Web Sharing option, maybe you upgraded and had it running some time in the past? Anyway, you'll need to open Terminal for this:
sudo killall httpd
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
The first will fail if you've already killed all the processes, the second disables startup.
-
He's on 10.7.4 according to the Q.2012-10-12 20:06:26 +00:00Commented Oct 12, 2012 at 20:06
-
Fair, but in the future as more users come back to this same question they may be on 10.8 (or later) so overtime this is a more relevant answer.Jeff– Jeff2012-10-12 20:29:20 +00:00Commented Oct 12, 2012 at 20:29
-
This solved it for me on 10.7.5; even though Web Sharing exists and is unchecked in System Preferences,
httpdwas surviving/respawning throughkillalluntil using thislaunchctlcommand (but this particular system might have other issues)rymo– rymo2013-06-13 18:50:13 +00:00Commented Jun 13, 2013 at 18:50 -
Wow! I was getting this error with MAMP Pro, and running the above fixed it. cl.ly/010Y2g2V3v3M/Image%202017-01-23%20at%201.35.59%20PM.pngMartyn Chamberlin– Martyn Chamberlin2017-01-23 19:58:11 +00:00Commented Jan 23, 2017 at 19:58
Open the Sharing preference pane in System Preferences and uncheck Web Sharing.
-
2FWIW, this option has been removed from Mountain Lion.2012-10-12 18:41:42 +00:00Commented Oct 12, 2012 at 18:41
-
1nope still running httpd on my lionNicolas Manzini– Nicolas Manzini2014-03-03 21:50:50 +00:00Commented Mar 3, 2014 at 21:50
sudo kill -9 [PID] and entering the process ID for PID ends any process. This can kill httpd . Now, you want to remove httpd form startup since you dont use it anyway.
Go to:
Library/LaunchAgents
Library/LaunchDaemons
Library/StartupItems
and remove httpd from these locations. This will stop it from ever running again. You can keep a backup though just in case you want the Apache web server in the future.
-
So why the downvote? This method works... not something hard.You can just google thisGutsygibbon– Gutsygibbon2012-10-12 19:05:06 +00:00Commented Oct 12, 2012 at 19:05
-
httpd is normally started by /System/Library/LaunchDaemons/org.apache.httpd.plist, and changing the contents of /System is not recommended. Using launchctl to manage it (as @Jeff recommended) is a much better way to do it.Gordon Davisson– Gordon Davisson2012-10-13 14:25:04 +00:00Commented Oct 13, 2012 at 14:25