Windows Server 2003 – How to Get a Service to Listen on Port 80

sockettcpipwindows-server-2003windows-service

I've coded a custom windows service that listens on TCP port 80 but when I try to install it on a Windows Server 2003 machine it fails to start because some other service is already listening on that port. So far I've disabled the IIS Admin service and the HTTP SSL service but no luck.

When I run netstat -a -n -o | findstr 0.0:80 it gives me the process id 4 as the culprit, but when I look at the running processes that process id points to the "System" process.

What can I do to get the System process to stop listening on port 80 and get my service to listen instead?

P.S. I should point out that the service runs fine if I install it on my Windows XP or Windows 7 development boxes. Also, I should specify that this has nothing to do with it being a service. I've tried starting a regular application that attempts to bind to port 80 on the Windows Server 2003 with the same outcome – it fails because another application is already bound to that port.

Best Answer

You want to stop the "World Wide Web Publishing Service".

By the way, the reason the port is actually opened by the 'System' process is because Windows Server 2003 moved parts of IIS into the kernel (specifically in the http.sys driver). This is so that things like static files can be served completely from the kernel (where the TCP/IP stack and filesystem drivers run) without a user-mode switch and provides better performance.