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
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">
Yes, I'm aware of them… simply I didn't want to incur in such overhead.
Anyway, the problem doesn't pertain Mac Ports'Apache instance. I was able to control it.
I said "was" because, drastically, I've removed Mac Ports (I think it would be better to do things in Mac style on a Mac: learned lesson) and still have the problem: httpd binds on 80 but it doesn't speak HTTP…
I would thank you for the excellent material you've suggested to me, especially for the lectio Googlis by the launchd's author … honeslty, the last place where I'd attemped to look.
Thank you for your support, it's time to study and learn… possibly fix.