I am running some sites on IIS 7.0. But yesterday one of my client asked me to host a Java website. I can't host that website directly so I installed tomcat server on port 8080. Whenever a browser send a request for that website, it should redirect to my tomcat internally. The client URL should not be updated.
No two applications can start a server on the same port, so IIS and Tomcat both operate on different ports. According to preference, we give a default port to one of the servers. Usually, we keep IIS as it is and keep Tomcat running on port 8080.
Adding a Tomcat context to IIS requires the addition of a new IIS virtual directory that covers the Tomcat context. For example adding a /example IIS virtual directory that covers the c:\tomcat\webapps\examples directory.
I was originally going down the same route as James but there is a much better (and for some reason less known) way.
Since you are running IIS7 you can setup Microsoft Application Request Routing. This will allow you to create a proxy from IIS to Tomcat. Here is a walk through on a blog. I have an example on my blog showing you how you can host multiple sites in IIS and route traffic based on the host header name. I did have a link to another blog but this is no longer available.
You need to use the Tomcat IIS connector. IIS will accept the request from the web browser, send it on to Tomcat, get the response from Tomcat and send it back to the web browser
http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With