Joseph DeVore's Blog: IIS
Viewing By Category : IIS / Main
July 5, 2007
Sometimes you have to run ASP for a client even if you'd prefer to stick with Apache and avoid IIS. If this is ever the case you'll notice rather quickly that IIS wants to bind to every IP on port 80 - and if you're running Apache bound to any IP and port 80, you'll see that IIS won't start and will tell you that the address/port is in use. Well good thing there's a simple solution that only takes a few minutes...
remove every IP bound to the NIC, individually:
explicitly tell IIS to listen on a specific IP:
check your work by issuing a query:
once that's all done, issue the following commands to stop and start HTTP and to reset IIS:
Once that's all done, you should be able to run IIS on a specific IP (10.0.0.21 in this example) at the same time as Apache HTTP Server.
First you need a Windows 2003 CD. Install the Support Tools - if you can't find that folder on the CD, search for httpcfg, since that's really what you need. Once you've found that folder, there should be an MSI file in there - so install it. If not then extract the httpcfg.exe to your system32 directory.
Once you've got httpcfg.exe or the support tools installed (change directory to where httpcfg.exe is located) and type the following commands:
stop IIS from listening on all available IPs:
httpcfg delete iplisten -i 0.0.0.0
remove every IP bound to the NIC, individually:
httpcfg delete iplisten -i 10.0.0.20
httpcfg delete iplisten -i 10.0.0.21
httpcfg delete iplisten -i 10.0.0.22
httpcfg delete iplisten -i 10.0.0.21
httpcfg delete iplisten -i 10.0.0.22
explicitly tell IIS to listen on a specific IP:
httpcfg set iplisten -i 10.0.0.21
check your work by issuing a query:
httpcfg query iplisten
once that's all done, issue the following commands to stop and start HTTP and to reset IIS:
net stop http
net start http
iisreset
net start http
iisreset
Once that's all done, you should be able to run IIS on a specific IP (10.0.0.21 in this example) at the same time as Apache HTTP Server.
Once you've restarted IIS and Apache, they should both start up and run happily ever after.
Probably not the best practice but if you must, there's a way!
Comments
Thanks for pointing me in the right direction. Although your post kind of helped me I found another MS hotfix that helped sort out my issue completely. I have a similar article on my blog to this topic<a href="blog.threenine.co.uk">http://blog.threenine.co.uk</a>

