How to solve the problem that Apache cannot start when port 80 is occupied

Source: Internet
Author: User

Enter netstat-abn-> c:/port80.txt

Find the program pid that occupies port 80 in the C-drive port80.txt file, and write down the pid. Open the Task Manager and click "View"/select a column.
, Select "PID (process identifier)", click the "process" tab, find the pid corresponding to port 80, and you can see that the program occupies
Changed the port of the program, and then restarted to make the change take effect.

If I find that the system occupies port 80, we can try the following solution:


1. Open the registry: regedit

2. Find HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ services \ HTTP.

3. Select Start on the right and change it to 0.

4. Restart the System. The System process does not occupy port 80.

After the restart, start Apache again.

Supplement:If the above method cannot be solved, I can see a method written by a foreign friend.

Translation:

This process is Http. sys. It is the driving component of http API and the Http stack server. If the port is occupied by Http. sys, some applications that are using http. sys are running. This is why Apache is blocked because Http. sys occupies port 80. We provide an application mechanism to help control port sharing, but I need to investigate what special applications cause this difficulty. If you can provide the output result of the "netsh http show servicestate" command, I can find out which application is using Http. sys. Before you disable Http. sys, follow these steps to run the command:
1. SC config http stat = demand
2. reboot
3. run the command (netsh http show servicestat) as administrator
Before using this command, you can disable http. sys as follows:
1. net stop http
2. SC config http start = disabled
So run net stop http
Confirm by y
Run SC config http start = disabled
Now, start Apache and you can start it.
Check out netstat-ano.
It is found that pid 4 occupies port 445

Apache modifies the listening port as follows:

Open httpd. conf
Modify Listen 80 to Listen 81
Apache can monitor more than one port at a time to implement multiple Http services.
Just add a line like Listen 82.

Do not forget to restart the Apache service to make the configuration take effect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.