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 have some web apps deployed on Tomcat, using the following configuration:

<Engine ...>
    <Host name="" ...>
    <Host name="" ...>
    <Host name="" ...>

For each of these apps, I can access them at the following two URLs:

Where x is a, b or c.

Is this normal, or have I done something wrong?

share|improve this question

Yes, this is the default configuration.

You have deployed all 3 web apps on a single Tomcat instance - so they will be accessible by default as

http://<some-domain-url>/x where x = a,b or c

Are you looking to restrict the pattern to or and

disallow ?

Then try nesting the web app via a <Context> element in the server.xml within your

<Host name="" ...>

Like so:

<Host name="" appBase="webapps"> 
    <Context path="/a" docBase="/a/"/> 

      <Host name="" appBase="webapps"> 
    <Context path="/b" docBase="/b/"/> 

If path is set to "" then you can get the app at the ROOT context, like instead of

share|improve this answer
What I want to achieve is being the only way accessing a - should give a 404 – Rich Dec 9 '10 at 12:23
I dont think that is possible with Tomcat alone. You need an Apache to front it to redirect to a 404 error page on that URL pattern – JoseK Dec 9 '10 at 12:31

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.