Running IIS and Apache on the same server
Submitted by chris on January 19, 2006 - 14:50. Apache Featured | Apache Install | IIS Configuration | IIS Featured
You can not have two services offered on the same ip and port numbers.
On the same server, different services (IIS and Apache) need a unique IP/Port
combination.
1) IIS might be binding to all ips on port 80. This has been the standard behavior of IIS since many years. So to run Apache with IIS, you first need to make sure IIS does not bind (i.e. listen) on all ips. The following article will help you disable IIS 6 from automatically binding to all ips on the Windows 2003 Server.
Before IIS6 (i.e IIS5), you simply had to set the metabase property "DisableSocketPooling"
to true (and that was it).
For details on doing this see: Disable socket
pooling on IIS5
Once you do that on IIS 6, you also have to specifically declare which ip to listen on (On IIS 4 or IIS 5 this step was not required).
Under IIS6 you need to also manually add all the ips it should listen to, using
the support tool httpcfg (see download link at bottom), like so:
httpcfg set iplisten -i xxx.xxx.xxx.xxx
With xxx.xxx.xxx.xxx being an ip like: 63.145.56.47
To list the "listened to" IIS6 ips: httpcfg query iplisten
Note: You need a IIS restart, at a minimum, to validate httpcfg changes.
I still set the DisableSocketPooling to true on IIS6 and rebooted to make
it work. Looks like the binding with IIS might be very low level (kernel) and a reboot is
best to make sure the changes are in effect.
To remove an ip:
httpcfg delete iplisten -i xxx.xxx.x.x
2) For Apache usable ips use the directive:
Listen 12.34.56.78:80
Link to download
Windows 2003 Support Tools SP1 (32bit).
httpcfg command reference
Note: The httpcfg command settings should be visible under the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList and you should never have to directly modify the registry. If however the httpcfg seems unable to correctly set or remove ips you might have to clean up the registry ListenOnlyList value. For details, see Microsoft KB 890015
| Attachment | Size |
|---|---|
| WindowsServer2003-KB892777-SupportTools-x86-ENU.exe | 5.21 MB |

