Running IIS and Apache on the same server

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
With being an ip like:
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

2) For Apache usable ips use the directive:

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

WindowsServer2003-KB892777-SupportTools-x86-ENU.exe5.21 MB

This info appears to infer

This info appears to infer that two IP's must be configured for the single interface on the WinServer as it is suggested via this example. It appears that IIS will only bind to a particular IP without the ability to specify any port numbers.

Is my assumption correct?

I do not think so...

I'm not 100% about this but I would assume that you can run both on the same ip. Just make sure they do not use the same port. For example IIS runs port 8080 and Apache runs on port 80 should work. By default web browsers (ie firefox) bind to port 80 so you would have to access your IIS site with something like:

If you try this, please confirm that it works (never tested). I got multiple ips so I don't really need to do this.




Thanks so much for posting this information. I'll be opening up a paypal account (haven't out of lazyness,) to send you some karma.


Hi Lex, I don't feel much

Hi Lex,

I don't feel much karma coming your way... ;-)