How is Apache still working

apache-2.2uninstall

Recently, I decided to set up a local development environment for my work projects. I'm a PHP developer, with just enough knowledge of Linux and Apache to break things mightily.

To get the local environment looking like my work environment, I had to upgrade PHP. When I did, Apache wouldn't restart. I decided I wanted to start fresh (this is where things went wrong) and that I'd reinstall Apache and PHP using MacPorts.

So, I went through and tried to delete all the Apache files. Yup.

I ran locate apache2 and deleted any folders that looked important. (I know, I know)

Then I did a /usr/libexec/locate.updatedb to make sure everything was up to date.

I even restarted my machine, just to make sure.

The issue is, http://localhost still works. As does an alias I set up, http://butler.

Shouldn't they not work? Now that I'm this far in, are there any tips for how to completely remove Apache so I can start over?

Worst case, I have a timemachine backup, so I can always just restore that… Thanks in advance.

Update: It officially isn't working anymore. I'm afraid I might have some files still lingering, but for the meantime, it seems that Apache is gone. Now to reinstall. Thanks for the help!

Best Answer

You say "(I know, I know)", but behave as if you don't know, so I'll explain :)

Just randomly deleting folders called apache2 is not likely to be effective. For one thing, apache isn't actually called apache; it's proper name is "httpd", by the Apache Foundation, so the most important files are probably called httpd on your system.

But the lesson to learn here is NOT that you deleted the wrong filenames. It's that you tried to delete things manually when operating systems provide uninstallers (or better, package management tools) for this sort of thing.

You also seem to be unaware of apachectl, which will help you stop the apache processes from a command line, and the system preferences, which let you do it from a GUI.

You might find this useful, for cleaning up:

http://wiki.apache.org/httpd/DistrosDefaultLayout#Mac_OS_X_.28Leopard.2C_Apache_2.2.29: