【错误】MsDepSvc.exe 站用了80端口/IIS的0×8ffe2740错误解决方

MsDepSvc.exe 站用了80端口

1. Issue description

I change the IIS 5.1(xp) port from 8080 to 80
(1)The website is is unavailable and has error mark.

got to he event view and find the following error:

The service could not bind instance 1.  The data is the error code.
For additional information specific to this message please visit the Microsoft Online Support site located at:http://www.microsoft.com/contentredirect.asp.
For more information, see Help and Support Center athttp://go.microsoft.com/fwlink/events.asp.


(2)when restart the website ,system prompt following error:

Unexpected error 0x8ffe2740 occurred.

2. finding and troubleshooting

I google this error message and find that the iis port are in use by another process.

Use following step to find the process which use 80 port

(1) open cmd and type in netstat -ano|findstr "80"

following are the output

  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       1376
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       2444
  TCP    192.168.47.176:2800    219.64.33.37:1352      ESTABLISHED     3928

(2)type in tasklist|findstr "1376"

following is the output
MsDepSvc.exe                1376 Console                 0     13,356 K

The port 80 is used by MsDepSvc.exe.

I rememberd that I install WebDeploy_2_10_x86_en-US.msi  to deploy the asp.net mvc application


Note: we can use following command to export port information to a file:

netstat -ano >port_list.txt


3.solution:

1. run services.msc in cmd  to open services window

 find the "Web Deployment Agent Service" service and stop it.


How to change the port in Web Deployment Agent Service?

CMD命令查看端口被什么程序占用

在安装Nginx for windows  时,每次启动都会如下信息:

2011/08/25 09:39:53 [emerg] 948#972: 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)

意思是80端口被占用,自己并没有开启特别的软件,端口肯定被我不知道的程序占用了,于是上网查了一下,下面的方式更方便。

    在windows命令行窗口下执行:

运行–cmd

C:>netstat -aon|findstr "8080"
TCP     127.0.0.1:80         0.0.0.0:0               LISTENING       2448
端口被进程号为2448的进程占用,继续执行下面命令:
C:>tasklist|findstr "2448"
thread.exe                     2016 Console                 0     16,064 K
很清楚,thread占用了你的端口,Kill it
如果第二步查不到,那就开任务管理器,进程—查看—选择列—pid(进程位标识符)打个勾就可以了
看哪个进程是2448,然后杀之即可。

原来是:Msdepsvc.exe 进程

What is Msdepsvc.exe

Msdepsvc.exewith description Web Deployment Agent Service is a process file from company Microsoft Corporation belonging to product Microsoft IIS Extensions.
The file is digitally signed fromMicrosoft Corporation – Microsoft Time-Stamp Service
We do not recommend removing digitally signed files from Microsoft Corporation

所以请注意安装了IIS7的朋友要特别注意这个Msdepsvc.exe他默认开启的占用了80端口

 强制终止进程:

      CMD命令:taskkill /F /pid 1408

原文地址:https://www.cnblogs.com/yongtaiyu/p/3512399.html