Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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" >

However that didn't work out; when going to http://server/Z/X/blah I get "The requested resource (/Z/X/blah) is not available."

Where am I going wrong?

share|improve this question

An alternate way to do this would be to setup tomcat behind apache via ajp. Then, use mod_proxy_ajp to map the http://server/Z/ to ajp://server/ instead.

share|improve this answer

If you add the Context within server.xml it will work as you want.

<Context docBase="x" path="/z/x" reloadable="true"  />

This approach is not recommended by the Tomcat docs, since any changes to server.xml means restarting the server disturbing all the web apps.

But, on the flip side, the practice of keeping this as you want in Catalina_Home/conf/Catalina/localhost/context.xml has some unreliabilities as others have reported.

See and

Why does tomcat like deleting my context.xml file?

share|improve this answer
Hi, Can you check out this question regarding redirection :… – We are Borg Oct 28 '15 at 10:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.