Redirecting URL to different web app in Tomcat

0 votes
asked Nov 6, 2010 by akaioi

Posted this to serverfault, but then decided it was more of a stackoverflow deal. I am running tomcat 6.0, and am having trouble configuring it to do what I want...

I have two web apps, call them X and Y, deployed as X.war and Y.war. Each has a servlet called blah.

So I can access them like so: http://server/X/blah http://server/Y/blah

What I want to do is pretend they are one web application Z, and be able to do this:

http://server/Z/X/blah --> as if I'd gone to http://server/X/blah

http://server/Z/Y/blah --> as if I'd gone to http://server/Y/blah

So I changed the (catalina_home)/conf/Catalina/localhost/X.xml as follows: < context override="true" path="/Z/X" reloadable="false" > . Similar for Y.xml.

However that didn't work out; when going to h ttp://server/Z/X/blah I get

"The requested resource (/Z/X/blah) is not available."

1 Answer

0 votes
answered Nov 6, 2010 by mschonaker

I haven't seen that done with Tomcat.

A common solution is to hide the Tomcat server behind an Apache2 server using mod_proxy.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter