1. 程式人生 > >apache 解決80端口占用問題

apache 解決80端口占用問題

1.使用netstat檢視埠,發現80埠被PID為4的程序佔用

2.開啟工作管理員,表頭右鍵,勾選PID,會發現PID為4的程序是個SYSTEM程序,描述為NT Kernel & System,

嘗試用滑鼠右鍵選單結束此程序,發現結束任務按鈕為灰不可用。

3.

微軟社群提供有這些資料,所以我們的解決思路是禁用http.sys。

I work on Http.sys technology at Microsoft and somebody sent me a link to this blog. I am a bit surprised by this behavior you are seeing on Windows7 Beta and with some help from you, I will like to find out the root cause of this issue so that we can take the appropriate action if needed.

You are right, Http.sys uses port 80. It is the driver component for httpapi, the server http stack (You can find more info on this technology at http://msdn.microsoft.com/en-us/library/aa364434(VS.85).aspx ). In your case, some application is running which is using http.sys to listen on port 80. This is preventing Apache from using port 80. We offer a mechanism for applications to help control port sharing but I’ll need to look into the specific application that’s causing you this conflict. If you can give us the output of following command “netsh http show servicestate”, then it will allow me to find out which application is using http.sys. Since you have disabled http.sys, please follow these steps listed below before running the command:

1. sc config http start= demand

2. Reboot

3. Run the command (netsh http show servicestate) as administrator

After you have run this command, you can disable http.sys as follows:

1. net stop htt

2. Sc config http start= disabled

Please let me know if you face any issues in the process.

Thanks,

Niranjan

解決問題:

1.以管理員身份執行cmd。

2.執行net stop http

3.執行 Sc config http start= disabled

4.再次查netstat –ano

發現pid 4的程序佔用埠從80埠變為了445埠

5.現在啟動Apache,可以成功啟動了。

到此咱們就解決了80埠被system程序佔用的問題。