Killing an unknown self restarting server on port 80 Mac OSX

This happens to me a lot. As @Gordon Davisson explains it is most likely the launchdeamon process conflicting with the service you have set up. Definitely stop the apachetl server.

sudo apachetl -k stop

Try to find all the httpd process, they should be the last ones

sudo lsof -i :80 // without grep

Then get the first process (most likely in the 1000s) should also be the lowest one.

sudo kill <firstHttpdPID>

This should kill ALL the processes running that httpd instance and then you get simply start back up your server. Must stop it first though or it will continue running again.


This is just a guess, but it might be the built-in version of apache, being launched (& restarted) by launchd (OS X's daemon manager). It's disabled by default, but might've gotten enabled somehow. You can try disabling it with:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

If that doesn't do it (it'll say something like "Could not find specified service"), you can check to see if it's some other launch daemon item by looking for the PID of the master process (the one running as root, not _www):

sudo launchctl list | grep <masterPID>

That won't necessarily tell you exactly what's going on, but might point you in the right direction.


Like Gordon suggested, that's the built-in version of the Apache web server.

You can stop it with

sudo apachectl stop

btw, the configuration for this webserver can be found in the /etc/apache2/httpd.conf directory.