Wednesday, November 25, 2009

IIS and apache on same machine with different IP

By default, IIS takes every IPs port 80, even if you've only specified each of the websites to have a single IP. You'll need to do the following:

1) Get httpcfg.exe (it's on the Windows 20003 CD, or google it).
2) Type the following in a command prompt to stop all IIS services: net stop http /y
3) Stop Apache service (don't know enough about apache to give you the correct command)
4) Use httpcfg to configure IIS to only listen on the IP you want it to (type at a cmd prompt, in the directory httpcfg is in): httpcfg set iplisten -i
5) Restart IIS Services: net start w3svc
6) Restart Apache service (again, don't know enough about apache to give you the command)

Should do the trick.

Edit: After step 4, run the following: httpcfg query iplisten

Make sure only the IP address you wanted listed shows up. If others still do, use httpcfg delete iplisten -i 192.168.1.x to delete the entry