Server administration

Having IIS and Tomcat running side by side on Windows

0 min read

It has been an interesting week for me as I’ve been doing a lot of DevOps and migrating a lot of the internal tools that we use. One problem I faced with was to make IIS and Tomcat friends. It must be easy right? Setup IIS, setup Tomcat, bind each to a respective IP address so they can run on the regular ports (80/443). You start IIS, you start Tomcat and then you look at the logs of Tomcat and you get the famous java.net.BindException: Address already in use exception.

There’s a solution.

By default, IIS goes through HTTP.sys and binds to all available IP addresses.
You have to tell it which addresses it can be bound to. To do that, run the following commands in a command prompt in administrator mode

You can run the netsh command for each IP Address you want IIS or any service that goes through HTTP.sys

If you want to see all the IP addresses bind to a port you can run the following again in a command prompt