IIS + Tomcat on the same machine

iisporttomcat

I need to run Tomcat7 and IIS 7.5 in the same machine where OS is Windows Server 2008 R2 Enterprise.
I have only 1 NIC and 5 IP addresses associated with the machine.
Lets say:

- 192.0.2.1, 192.0.2.2 for IIS
- 192.0.2.3, etc for Tomcat

Port 80 is used by IIS.

The calls to IIS site do not have any problem since the mapping www.site1.com => 192.0.2.1:80 permits that the user just type the name in the url and will not see the default port 80.

But tomcat can not use port 80.

I can use IIS to parse the incoming HTTP requests, based on domain name, and send the proper traffic to Tomcat listening on different port.
For example, www.tomcatapp.com is redirected from IIS to 192.0.2.3:8080 where Tomcat is listening too.
Or without using, IIS "force the users" to call Tomcat site as www.tomcatapp.com:8080

Can be another more smarter way?
Why IIS is "blocking" port 80 for all 5 IPs?
Will I have a benefit or a penalty using Tomcat behind IIS?

Best Answer

The downside of redirecting up to port 8080 is that you're redirecting up to port 8080. Your users will see it in their address bar, which looks kinda unprofessional; additionally, some corporate firewalls and web filters will block access to port 8080, so that may be an issue too depending on your clientele.

If you can dedicate one of your IPs (or if it's this way already) to the Tomcat web app, then you can actually get IIS to stop binding that port:

netsh http add iplisten 192.0.2.1
netsh http add iplisten 192.0.2.2
netsh http show iplisten

Where 192.0.2.1 and 192.0.2.2 are the addresses you want IIS to bind to port 80 on. Once that's done, restart the IIS service. See here for reference.

This will free up port 80 on the IP address that you want to have Tomcat bind to, allowing you to listen with it directly.