Deploy war application in Tomcat as ROOT

After deploying the war file in webapps,

I need something like this:
NOT this:


There should be 3 ways to do it:


rename the war to ROOT. war




create a new HOST entry in TOMCAT_HOME/conf/server.xml

  1. <Host name=”” appBase=”www”
  2.       unpackWARs=”true” autoDeploy=”true”
  3.       xmlValidation=”false” xmlNamespaceAware=”false”>
  4. </Host>

with this sample setup, you will have a folder in the root of TOMCAT_HOME called ‘www’, and it will only work with the host name – all other requests (localhost,, etc) will hit the localhost host configuration.

In the ‘www’ folder you need to have a ‘ROOT’ folder, which again contains the contents of your ‘myapp’.




Deploy war as (for example) war_name.war and configure the context root inside the < Host > element of conf/server.xml to use your war file :

<Context path="" docBase="war_name" debug="0" reloadable="true"></Context>

The first one is easier, but a little more kludgy. 
The second one works for specific domain.
The third one is probably the more elegant way to do it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s