How to «really» stop httpd daemon?
I've installed a custom version of Apache2 that I want to run in complete replacement of the system provided one.
I tought it would suffice to stop the http service by the System Preferences but it didn't work.
What follow is a troubleshooting session I've done in an attempt to solve the problem.
I would point out that I'm not an Mac OS X power user.
I was attempting to reconfigure my webserver and I've noticed that, even if I killed it (by ps -aux | fgrep apache2 evidence) I had still an httpd process running effectively listening on port 80.
I've killed it and I've happily noticed that it wasn't respawn.
I've than ran Safari pointing to localhost and noticed it didn't failed to connect.
Reissued lsof -i | fgrep LISTEN I've found some httpd processes were binding the 80 port again.
At this point i know for sure:
- "my" apache2 processes aren't running
- system httpd have been started again
Check which was listening by telnet
/System/Library/LaunchDaemons$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Connection closed by foreign host.
I've observed that I didn't get an HTTP-conform reply but a socket was effectively allocated.
I've checked the configuration of /System/Library/LaunchDaemon/org.apache.httpd.plist and found
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>org.apache.httpd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/httpd</string>
<string>-D</string>
<string>FOREGROUND</string>
</array>
<key>OnDemand</key>
<false/>
<key>SHAuthorizationRight</key>
<string>system.preferences</string>
</dict>
</plist>
Any idea?
MacBook Pro, Mac OS X (10.7)