When you try to run Apache (or any other web server service), it can happen that Windows is not allowing to start it, because port 80 is already in use. To find out which process is using port 80, you can use the Resource Monitor (just run resmon.exe). Open the ‘Network’ tab and open the ‘Listening Ports’ section.
Another way to find out is to use ‘netstat -a -n -o | find “:80”‘.
How to solve the problem
If the process is just a ‘normal’ process, you just need to stop the associated service to free port 80. If it’s the System process (PID=4), that is using port 80, then we need to disable http.sys.
There are two ways to disable it:
- Go to device manager, select ‘View -> Show hidden devices’, go to ‘Non-plug and Play Driver -> HTTP’ and double click it to disable.
- Launch RegEdit, go to ‘HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP‘ and change to value of ‘start‘ to 4.
After this you need to reboot your computer.
The following values are valid for the ‘start’ property: