Monday, 7 February 2011

Running IIS and Apache on the same Windows 2008 R2 Server

I’m trying to get a Composite C1 site and the Apache WebDAV front-end to Subversion running on the same Windows 2008 R2 server, and doing so requires a bit of trickery with IP address bindings and such, and I thought I’d share it – partly ‘cos it’s useful, and partly because I’m bound to have to do this again in three months time and there’s no way I’ll remember how I did it. First off, make sure your box has (at least) two IP addresses – I’ve bound mine to and
To get IIS to listen on ONLY, you’ll need to run the netsh.exe utility.
netsh>http add iplisten ipaddress=
IP address successfully added
netsh>http show iplisten
IP addresses present in the IP listen list:
(note that netsh.exe is a Windows 2008 utility – if you’re running Windows 2003 or earlier, look up the docs on using httpcfg.exe to achieve the same thing)
If you now fire up a web browser and go to, you should get the default IIS7 “Welcome” screen, and shouldn’t return anything at all. Now to get Apache listening on Find your httpd.conf file – if you’ve just installed CollabNet Subversion (like I have) it’ll be in the \data\conf folder of wherever you put your SVN install.
You’ll need to find the Listen directive in httpd.conf, and modify it to say:
That’s all. Next time – to get Git running on the same Apache installation… until then, happy hacking.

UPDATE: After running this for several years, I've found that occasionally, following an unscheduled shutdown or power outage, IIS won't come back up properly after the box is restarted. Sites will respond on http://localhost/ but trying to access them via hostname gives an ERR_CONNECTION_RESET message.
This can be fixed by removing and re-adding the HTTP binding:
netsh> http
netsh http> delete iplisten http> add iplisten http> exit



Anonymous said...


Amar pawar said...

very helpful....but I changed the IIS and apache port without using commands ....i followed this tutorial -

Dylan Beattie said...

If you can run them on different ports, it's much more straightforward. My problem was I needed them both listening on port 80.