I have another service that needs to use multiple ports on one IP of a server. When IIS starts, it uses all unused IPs so the other service fails to bind its IP. If I start the other service first it is able to use the IP but I can't rely on the order of services starting or that they won't need to be restarted at some point. Is there any way to make IIS not use an IP at all?
Apparently in IIS6 the UI setting is broken and this needs to be done using httpcfg of which the gist is:
I finally found the answer:
http://devlicio.us/blogs/billy_mccafferty/archive/2008/09/02/prevent-iis-from-binding-to-all-assigned-ip-addresses.aspx
There's a utility called
httpcfg.exe
that can be used to specify on which IPs IIS will listen.I downloaded the support tools ( http://msdn.microsoft.com/en-us/library/windows/desktop/aa364478%28v=vs.85%29.aspx ) and used httpcfg.exe as described in several posts (i.e. stop http service, add desired ip numbers excluding the one I needed to bind elsewhere). I got to the point where
no longer listed my exclusion number. However, running
and looking at the netstat.txt revealed that PID 4 was still listening to port 80 (and 443) on ALL ip numbers via 0.0.0.0. Thus the ip number that I needed separated out was not yet available for use.
The final step was to explicitly DELETE 0.0.0.0 -- even though it was not on the iplisten list.
THAT worked immediately. No server reboot required, by the way.
Sure. Fire up Internet Information Services Manager. Expand until you see your sites under "Web Sites."
For each site, right-click and choose Properties. On the Web Site tab click "Advanced" next to IP Address and fill in only the addresses you want used (instead of the default "All Unassigned")