IIS 7.0 will not release port 80 when service is stopped. Cannot run Apache on port 80

Solution 1:

Execute the following command:

netsh http show servicestate

Have a look for entries that look like:

Registered URLs:
    HTTP://+:80/<SERVICE_NAME>

That'll tell you what's listening on port 80.

Watch out for Skype as well, that has a nasty habit of grabbing port 80.

Since Windows 2003, Microsoft created a kernel mode http driver. A feature of this driver is the kernel mode listener. The kernel mode listener provides a feature called port sharing where more than one application can listen on the same port. Applications that wish to do this register a URI namespace for their application. For example on my machine I have the the MS Deployment Agent Service listening on this URL:

http://+:80/MSDEPLOYAGENTSERVICE/

Requests to that particular URI are handed off to the application that registered that particular URI.

IIS is another application that will register itself with the kernel mode listener service and its various bindings.

The problem with Apache on Windows is that it doesn't use the Windows HTTP kernel mode subsystem and register itself (this is not a slight, just a fact of life). It's own process tries to bind directly to whatever ip/port combo you configured. Of course if the HTTP listener service is sitting there listening on URI's registered on port 80 by other services it'll be kicked off.

So basically if you want to use port 80 I think you need to find and kill everything that could possibly be listening there (if you do a Listen 80) on the IP address you want to use for Apache.

If may even be necessary to delete registered URI's that are no longer in use which may not have been properly cleaned up when an application uninstalled itself.

The easiest workaround, not ideal and I'm sure you know it already, may be to configure Apache for Windows to listen on something that's not port 80.

For further reading see:

About HTTP Server API - MSDN