需要在一台服务器上同时配置IIS和Apache,他们分别使用不同的IP地址。
现在的问题是:服务器绑定了多个IP,IIS中的站点只占用了其中一个,但只要启动该站点,则本机上所有的所有IP的该端口就已经使用,导致Apache无法启动。
例:
1、网卡上两个IP地址,分别是192.168.1.1,192.168.1.2
2、在IIS中将默认Web站点分配IP地址192.168.1.1
3、启动默认Web站点
4、浏览器浏览:http://192.168.1.1成功,http://192.168.1.2失败
5、telnet 192.168.1.2 80,发现IP地址192.168.1.2的80端口已经占用
6、在Apache中设置IP地址为182.168.1.2,端口80,启动失败
如何解决?
---------------------------------------------------------------
问题解决
IIS Binds To All Available IP Addresses When It Starts
The information in this article applies to:
Microsoft Internet Information Services version 5.0
SYMPTOMSWhen you start Internet Information Services (IIS) 5.0, IIS appears to bind to all Internet Protocol (IP) addresses on a server, not just the IP addresses that are assigned to Web sites. In addition, when you run another service that uses port 80 on an unused IP address, IIS may return an error.
CAUSETo enhance performance, IIS 5.0 uses "socket pooling", in which IIS binds to all IP addresses when it starts.
WORKAROUNDTo work around this behavior, disable socket pooling in IIS as follows:
At a command prompt, switch to the "C:\InetPub\AdminScripts" folder.
Type the following command:
CSCRIPT ADSUTIL.VBS SET W3SVC/DisableSocketPooling TRUE