There are two ways to deploy a WAR file of a Java web application on the Apache Tomcat web server
Using the command line
- Copy the WAR file into the webapps folder of the Tomcat installation directory,
- Make sure the CATALINA_HOME environment variable points to the Tomcat directory (not the bin subdirectry)
- Open a Terminal window or Command Prompt,
- Navigate to the bin directory of the Tomcat web server installation directory,
- Execute
startup
- Tomcat will unzip the war file into a directory named after the WAR file and display the message similar to this.
C:\Program Files\apache-tomcat-8.5.23\bin>startup
Using CATALINA_BASE: “C:\Program Files\apache-tomcat-8.5.23”
Using CATALINA_HOME: “C:\Program Files\apache-tomcat-8.5.23”
Using CATALINA_TMPDIR: “C:\Program Files\apache-tomcat-8.5.23\temp”
Using JRE_HOME: “C:\Program Files\Java\jre-9.0.1”
Using CLASSPATH: “C:\Program Files\apache-tomcat-8.5.23\bin\bootstrap.jar;C:\Program Files\apache-tomcat-8.5.23\bin\tomcat-juli.jar”C:\Program Files\apache-tomcat-8.5.23\bin>
Using the Tomcat user interface
- Remote into the web server,
- Copy the WAR file to a temp directory,
- Open the Tomcat web user interface at http://localhost:8080/manager
- Log in with the credentials specified for the manager-gui role in the tomcat-users.xml file of the conf Tomcat folder,
- In WAR file to deploy section click the Choose File button and select the WAR file,
- Click the Deploy button,
- Tomcat will unzip the war file into a directory named after the WAR file in the webapps folder of the Tomcat installation directory.