After deploying the war file in webapps,
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
- <Host name=”www.mysite.com” appBase=”www”
- unpackWARs=”true” autoDeploy=”true”
- xmlValidation=”false” xmlNamespaceAware=”false”>
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 www.mysite.com – all other requests (localhost, 127.0.0.1, 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.