How do I deploy a WAR file in Tomcat?
Alex ChaffeeNote that if you deploy a WAR file in this manner, you do not need to make any changes to server.xml -- it will automatically be recognized and activated. However, if you wish to specify non-default options for this webapp, you may do so by adding an element like
Currently (as of version 3.2) the procedure for deploying a new WAR file is:
- Stop Tomcat.
- Delete existing deployment.
If you have previously deployed "foo.war" in TOMCAT_HOME/webapps, then it has been unpacked into webapps/foo/... You must delete this directory and all its contents. On Unix, this can be done with
rm -r $TOMCAT_HOME/webapps/foo
- Copy WAR file to TOMCAT_HOME/webapps/.
- Start Tomcat.
This process may become easier in the future. A "deploy tool" is on the Tomcat "to-do" list.
<Context docBase="webapps/foo" ...to server.xml.