[Port Service] Solution to Windows Unable to Start Apache Port 80 is Occupied

Cause of problem

The test missed the scan and found that port 80 was opened on the computer, and the access did exist. Reminiscent of the failure to enable the Apache service earlier, I thought about solving it.
image.png
image.png

Solutions

Method 1:
Find the application that occupies the port and end it directly through the task manager.
Method 2:
If it cannot run and is interrupted, it is recommended to find the system HTTP service and adjust it to manual startup, so that it will not be occupied if it does not start automatically after booting.
Method three:
Find the registry information for the system to start the HTTP service and modify the function switch so that port 80 will not be occupied even if it is started.

Method one operation steps

1. Check the process status of port 80

netstat -ano | findstr "80"

image.png
Found that port 80 is open and PID is 4

2. Find the task application
and open the detailed column of the task manager to view the corresponding task.
image.png

Right-click the properties to view the specific application:
image.png
it was finally discovered that an apparently unknown ntoskrnl.exeapplication occupied port 80. Check the related information and find that it is a system service, which cannot be easily interrupted.
image.png

The system application cannot be terminated directly. Look for system services from another angle. Generally, 80% are HTTP services. We can also handle the corresponding system services.

Method 2 steps

1. Find the HTTP service, which is the WWW service
image.png

2. Right-click and change properties to manual start
image.png

Change it to manual to facilitate subsequent use and ensure that port 80 is not occupied.

3. Restart and test whether it has been closed.
image.png
It is found that it has been closed.

Method three steps

1. Open the registration form
image.png
2. Search for the corresponding registration information

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP 

image.png

3. Right-click Start and select Modify Close Function
image.png

What do these numerical data mean?

  • 0 : Usually means disabling or turning off a feature or option.
  • 1 : Usually means enabling or turning on a certain function or option.
  • 2 : Sometimes it means that a certain function or option is partially enabled or partially turned on, or it can also mean the default setting of a certain function or option.
  • 3 : Specific to a certain application or system configuration, the specific meaning may need to refer to relevant documents or reference materials.

4. Finally, restart and test whether the port is released.

Thinking summary

1. Everyone's port occupancy situation is different, and other services of the local SQL Server may also be occupied. You can also find the corresponding application according to method 1 and terminate the process.

2. If the occupying end is not a specific application, but a system call service, it will be associated with many services. It is recommended to find the service we need and process it directly, such as the WWW service, otherwise it may cause system exceptions.

Guess you like

Origin blog.csdn.net/weixin_54430466/article/details/132334939