Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal redirection to tomcat from IIS 7.0?

Tags:

iis-7

tomcat

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.

like image 675
user294754 Avatar asked Mar 16 '10 13:03

user294754


People also ask

Can Tomcat and IIS run on same server?

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.

Does Tomcat need IIS?

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.


2 Answers

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.

like image 129
Bronumski Avatar answered Oct 01 '22 11:10

Bronumski


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

like image 33
jqa Avatar answered Oct 01 '22 10:10

jqa