Deploying  War Files 

We have seen all the folder structure of tomcat server. We are mostly interested in the /webapps directory, which is where all of our WAR files will be deployed.Once you have a WAR file, containing your web application, deploying web applications to Tomcat is a simple two-step process.

Steps Involved in Deploying a Web Application to Tomcat

  • Copy your WAR file to the TOMCAT_HOME/webapps directory.

  •  Add a new Context entry to the TOMCAT_HOME/conf/server.xml file, setting the values for the path and docBase to the name of your web application for example:- <Context path="/test" docBase="test" debug="0" reloadable="true" />

  • Restart Tomcat after completing these steps. Your application should now be running.

  • Access the  http://localhost:8080/YOURAPPNAME/ in your broswer. The 8080 is the port number which is default for tomcat.

Note:- if you look at the TOMCAT_HOME/webapps directory, you will see a new directory matching the name of your WAR file. This is where your working web application now exists. When Tomcat starts it will extract all WAR files that have been recently placed into the TOMCAT_HOME/webapps directory.


Copyright © 2015 VisualBuilder. All rights reserved