IIS 抱怨端口未使用时正在使用

Ste*_*ane 5 iis-7.5 windows-server-2008-r2

我需要恢复应用程序,以便在逐步淘汰之前可以由第三方安全存档。

为了在不危及整个服务器的情况下这样做,我想强制用户在连接之前进行身份验证,这意味着需要 TLS。

不幸的是,该服务器上的 443 端口(xxx.xxx.xxx.120)被另一个应用程序(使用自己的 HTTP 服务器的网络邮件系统)占用,所以我向服务器添加了一个新的公共 IP(xxx.xxx.xxx .120) 并在 IIS 中为这个新 IP 上的端口 443 添加了一个绑定:

网站的 IIS 绑定

我还确保另一个应用程序没有绑定在 0.0.0.0:443 上,而是使用特定的 IP 地址。

最后,我跑了netstat -ano | find ":443",得到了这个:

TCP    xxx.xxx.xxx.120:443     0.0.0.0:0              LISTENING       3016
TCP    xxx.xxx.xxx.120:443     0.0.0.0:0              LISTENING       3016
Run Code Online (Sandbox Code Playgroud)

xxx.xxx.xxx.120为初始服务器IP地址,新的为xxx.xxx.xxx.122。

作为一个很好的衡量标准,我也运行了netstat -aon | Find "xxx.xxx.xxx.122:443"(新 IP)并且一无所获,正如预期的那样。

不幸的是,当我尝试启动 Web 应用程序时,收到以下错误消息:

错误消息:该进程无法访问该文件,因为它正被另一个进程使用。 (来自 HRESULT 的异常:0x80070020)

这个错误是 IIS 抛出的一个错误,如果它尝试绑定到的 IP:Port 被占用,但 netstat 清楚地表明它可用。

我错过了什么?

编辑:当我尝试启动服务时,系统事件日志中有两个事件:

Log Name:      System
Source:        Microsoft-Windows-IIS-W3SVC
Date:          7/19/2014 11:59:44 AM
Event ID:      1004
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      xxxx
Description:
The World Wide Web Publishing Service (WWW Service) did not register the URL prefix https://XXX.XXX.XXX.122:443/ for site 2. The site has been disabled. The data field contains the error number.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-IIS-W3SVC" Guid="{xxxxx}" EventSourceName="W3SVC" />
    <EventID Qualifiers="49152">1004</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2014-07-19T09:59:44.000000000Z" />
    <EventRecordID>119596</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>System</Channel>
    <Computer>xxxx</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="UrlPrefix">https://XXX.XXX.XXX.122:443/</Data>
    <Data Name="SiteID">2</Data>
    <Binary>20000780</Binary>
  </EventData>
</Event>
Run Code Online (Sandbox Code Playgroud)

Log Name:      System
Source:        Microsoft-Windows-HttpEvent
Date:          7/19/2014 11:59:44 AM
Event ID:      15005
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      XXX
Description:
Unable to bind to the underlying transport for [::]:443. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine.  The data field contains the error number.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-HttpEvent" Guid="{xxx}" EventSourceName="HTTP" />
    <EventID Qualifiers="49152">15005</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2014-07-19T09:59:44.330234300Z" />
    <EventRecordID>119597</EventRecordID>
    <Correlation />
    <Execution ProcessID="4" ThreadID="88" />
    <Channel>System</Channel>
    <Computer>XXX</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="DeviceObject">\Device\Http\ReqQueue</Data>
    <Data Name="Address">[::]:443</Data>
    <Binary>0000040002003000000000009D3A00C0000000000000000000000000000000000000000000000000430000C0</Binary>
  </EventData>
</Event>
Run Code Online (Sandbox Code Playgroud)

小智 2

2. 事件“[::]:443”中显示的 IP 地址看起来像 IPv6。也许两个 Web 应用程序都尝试绑定除您指定的 IPv4 地址之外的所有 IPv6 地址。尝试暂时禁用 IPv6 查看问题是否消失。