Setting up 2 webservers at port 80 of the same machine

I had this problem where I have to setup IIS on a machine that already runs a webserver (CommunigatePro Webmail). The issue was I needed both to be accessible via port 80 so my clients will not have to connection to non-standard ports.

After much research and testing, I managed to get this running.

The solution is simply to have 2 IP address on the server (one for IIS, one for the other webserver), configure them both to listen only to their specific IPs. Now this seems easy, you just have to assign the IPs to the respective servers to listen to and that's it! But the problem is, IIS locks in to the port number, regardless of the IP address. Even if you specify a website as listening to only a particular IP, IIS will block the entire port number (80).

Here's the work around on that:
  • stop the WWW service (net stop http /y)
  • grab the httpcfg.exe from your Windows 2003 install CD. It's packaged in the Support/Tools/Support.cab file.
  • run this on the server:
    httpcfg set iplisten -i x.x.x.x:yy    (where x.x.x.x is the IP address of your IIS server and yy is the port. You can omit :yy if you wish)
  • the result should be something like HttpSetServiceConfiguration completed with 0. If it's not 0, then there's a problem somewhere
  • verify if you had it right:
         httpcfg query iplisten
  •  It will show you the IP address/ports that IIS will listen to. Re-check your IIS and the other web server, make sure both are set to listen only to thier specific IP addresses.
  • Restart the server (this is important. I have everything configured right but worn't run properly until I restarted the server. Somehow, services restarts are not enough)

Comments

Popular posts from this blog

Windows RRAS VPN configuration when server is behind NAT

Lenovo X1 Carbon Battery Problem - Plugged, Not Charging

Multiple Remote Desktop sessions on Windows XP