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,
- Tomcat will unzip the war file into a directory named after the WAR file and display the message similar to this.
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.
When you install the Apache Tomcat web server there are some configuration settings you need to make to be able to administer and use it.
Administrator user accounts
When you install the Apache Tomcat web server there is no admin user account specified, so nobody can log into the admin web user interface. To add an admin user account
- Remote into the web server
- Open the Tomcat user configuration file at
- On Linux at $TOMCAT_HOME/conf/tomcat-users.xml
- On Windows at C:\Program Files\apache-tomcat-…\conf\tomcat-users.xml
- Add an admin user
<user username="admin" password="admin" roles="manager-gui"/>
- Restart the Tomcat service for the change to take effect.
With the default settings, Tomcat is accessible on port 8080. To be able to use the web applications served by Tomcat, open port 8080 on the local firewall.
Tomcat is one of the most popular free web servers. Tomcat runs on the Linux, Macintosh, and Windows operating systems.
To install Tomcat
Install the Java Runtime Environment (JRE)
- Download the Java JRE from http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Install the Java JRE
- Execute the downloaded .exe file
- Create an environment variable to point to the installed Java
- If you installed the Java JDK (Java Development Kit)
- JAVA_HOME=c:\Program Files\Java\jdk-…
- If you installed the JRE (Java Runtime Environment)
- JRE_HOME=C:\Program Files\Java\jre-…
- Download the Tomcat installer from https://tomcat.apache.org/
- To select the right file to download read the explanation on the page linked to “Please see the README file for packaging information”.
Select the installer based on the operating system and the Java environment you want to run:
- 32 bit Java Virtual Machine on32 bit or 64 bit Windows: apache-tomcat-[version]-windows-x86.zip
- 64 bit Java Virtual Machine on 64 bit Windows: apache-tomcat-[version]-windows-x64.zip
- Unzip the downloaded archive and move the apache-tomcat-x.x.x directory to C:\Program File
- Create the Tomcat environment variable
- Open a terminal or console in the Tomcat bin directory
- Enable the access to the Tomcat server through the firewall
- On Windows
- Open a web browser on the server and navigate to http://localhost:8080/
- You should see the Tomcat default page
Auto start Tomcat
If you want to use Tomcat as a web server, it should start automatically when the computer starts.
- Open a command prompt in the tomcat bin directory
- On the User Account Control popup click the Yes button
- The last message in the command prompt should say
The service ‘Tomcat..’ has been installed.
- Open Services and select the Apache Tomcat service
- Set the Startup type to Automatic, click the Start button to start the service, and click OK.
When the Atlassian Confluence wiki is installed on a Windows server, it frequently becomes unavailable. Sometimes it is possible to restart the Atlassian Confluence Windows service, but most of the time the Stop phase times out with:
Windows could not stop the Atlassian Confluence service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
To make Atlassian Confluence work again
- Open Task Manager,
- End the tomcat…exe process,
- Start the Atlassian Confluence Windows service.