Sempai.inFo - 411

411 info and facts.. also did you know?

January 21, 2009

Configure IIS to use one IP address
   Author: admin

Posted in Tutorials, Windows Server | |

So I ran into an issue today on a Windows 2003 server today.. Client wanted to run IIS and Apache on the same server.. I figured this wouldn’t be an issue because you can tell IIS to use one IP add another IP to the Network Interface and then tell Apache to use the second IP.. Well this turned out to be something far more complex.. First off even when setting IIS6 to listen on only one IP.. it STILL listens on all IP’s available so as this story would pan out Apache wouldn’t start because it couldn’t bind to the IP address on port 80 because it was already in use by IIS but I found the following trick to get around the issue.

Please note you should schedule a small block of time to do this as it requires a server reboot.. so figure the amount of time you will need is how ever long it takes your Server to shutdown and reboot +5-10min

Configure IIS to only listen to the one IP and make a note of that IP.

Open a command prompt (Start>Run "cmd" > Hit Enter)
Then type the following at the black screen: net stop http /y
This will stop all IIS and IIS related services

Next, run the httpcfg.exe this can be found on your Windows Server 2003 CD-ROM under
\support\tools\support.cab if you double click this file it should let you open it like a folder and copy the httpcfg.exe file to somewhere on your computer (example C:\temp)

At that command prompt you had open move to C:\temp or wherever you put the httpcfg.exe file
cd c:\temp

then type the following command
httpcfg set iplisten -i :80
For replace this portion with the IP address you set in IIS earlyer.. so if that ip was 192.186.0.102 then your command would be the following..
httpcfg set iplisten -i 192.168.0.102:80

If the command is successful, you will see the following message at the prompt.

HttpSetServiceConfiguration completed with 0

In some situations it will be necessary to reboot the server after this change but you can try to start the IIS by
net start w3svc

Change to following folder cd\IntePub\AdminScripts and enter run the following command:
cscript adsutil.vbs set /smtpsvc/1/DisableSocketPooling true

1 Comment »

  1. Thank you so much for posting this. This is exactly what I need.

    I can’t believe how retarded IIS is. What a (*self-censored*)…

    Thanks again for the help!

    Comment by Dawning — June 24, 2009 @ 8:33 am

RSS feed for comments on this post. TrackBack URI

Leave a comment



Your Ad Here