1

I installed the latest nginx on widows 7 enterprise. got an error "nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)".

The tools TCPView showed that pid 4 SYSTEM was listening on port 80. How to determine which service is running as SYSTEM as pid 4 ? If I goto a browser with localhost, I get a HTTP 404 message.

anjanb
  • 151
  • 1
  • 2
  • 13

2 Answers2

2

No service is running as PID 4. PID 4 is always the system process itself, in Windows the http.sys kernel driver (running inside of PID 4) usually takes care of all http traffic and services and applications can register IP addresses and URLs to be forwarded to them.

Run the following command:

netsh http show servicestate

or if the output is too long pipe it:

netsh http show servicestate > %temp%\httpservicestate.txt

you may see registered URLs or IP addresses in the output but also process IDs or Controller process IDs, check these IDs against a list of running processes to find the process(es) that using http.sys

Peter Hahndorf
  • 13,763
  • 3
  • 37
  • 58
  • thanks for the detailed info. So, why is this service preventing the nginx webserver from listening on port 80 ? I also see the TCPView shows this process (pid 4, system) as listening to 80. How do I prevent this process from listening to port 80 ? My goal is that nginx server should be started and listen to traffic on port 80. – anjanb Jun 30 '16 at 05:57
  • from running "netsh http show servicestate", I see a registered URL : HTTP://+:80/116B50EB-ECE2-41AC-8429-9F9E963361B7/. And other info was : Number of active processes attached: 1 Process IDs: 5068. Following pid 5068, led me to svchost.exe and a service called PeerDistSvc(description : BranchCache). – anjanb Jun 30 '16 at 06:07
-1

If you do a right clic on an empty space of your task bar and select "Start Task Manager" then go for the services tab, you will see all the services currently available/running/stopped on your computer, listed with there PID, that will probably show you which one is the 4.

The other idea I have in mind is that you probably have Skype installed, it come with a "something" (sorry for the lack of details, I never really looked what is it's purpose exactly) that is bind on port 80 and start automatically by default, Skype's options allow you to disable it and free your port.

Kane
  • 131
  • 7
  • unfortunately, as @Peter Hahndorf says below, pid 4 is system and doesn't run any "windows service". Again, as he says below, it is responsible for http.sys kernel driver. I have skype installed but the skype process is not listening to port 80 but pid 4(system) is. – anjanb Jun 30 '16 at 05:59