8i | 9i | 10g | 11g | 12c | 13c | 18c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Linux » Here

Apache Tomcat 8 Installation on Linux (RHEL and clones)

Apache Tomcat 8 is not available from the standard RHEL distributions, so this article provides information about the manual installation and basic configuration of Apache Tomcat 8 on RHEL and its clones from tarballs. The tarball approach to installation is largely unchanged compared to previous tomcat versions.

Related articles.


Download the following software. This article assumes these downloads are present in the "/tmp" directory on the server.


Create a user called "tomcat" to own the Tomcat installation.

# useradd tomcat

Install the JDK from the tarball under the tomcat user.

# su - tomcat
$ tar xzf /tmp/jdk-8u144-linux-x64.tar.gz

Install Tomcat from the tarball under the home directory of the "tomcat" user.

$ tar xzf /tmp/apache-tomcat-8.5.20.tar.gz

Set the following environment variables and append them to the "/home/tomcat/.bash_profile" so they are set for subsequent logins.

export JAVA_HOME=/home/tomcat/jdk1.8.0_144
export CATALINA_HOME=/home/tomcat/apache-tomcat-8.5.20

Start and stop Tomcat using the following scripts.

$ $CATALINA_HOME/bin/startup.sh
$ $CATALINA_HOME/bin/shutdown.sh

The Tomcat logs are written to the "$CATALINA_HOME/logs/" directory by default.

Once Tomcat is started, the following URL should be available. Configuration for the management URLs is discussed below.


Remember to open up the port on the firewall if you want to access the site from other servers on the network. Information about the Linux firewall is available here.

Checking the Status of Tomcat

There are several ways to check the status of the service.

$ $ netstat -nlp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp6       0      0 :::8080                 :::*                    LISTEN      7564/java

$ ps -ef | grep tomcat
oracle    7564     1 10 18:32 pts/0    00:00:15 /u01/jdk1.8.0_131/bin/java -Djava.util.logging.config.file=/u01/apache-tomcat-8.5.20/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /u01/apache-tomcat-8.5.20/bin/bootstrap.jar:/u01/apache-tomcat-8.5.20/bin/tomcat-juli.jar -Dcatalina.base=/u01/apache-tomcat-8.5.20 -Dcatalina.home=/u01/apache-tomcat-8.5.20 -Djava.io.tmpdir=/u01/apache-tomcat-8.5.20/temp org.apache.catalina.startup.Bootstrap start
oracle    7681  2645  0 18:35 pts/0    00:00:00 grep --color=auto tomcat

$ HTTP/1.1 200 OK
HTTP/1.1 200
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 13 Jul 2017 17:35:36 GMT


The status is also available from the HTML management page.

Configuration Files

The main locations of configuration and log information are shown below.

Release Notes        : $CATALINA_HOME
Config               : $CATALINA_HOME/conf
Bin Directory        : $CATALINA_HOME/bin
Webapps              : $CATALINA_HOME/webapps
Logs                 : $CATALINA_HOME/logs

Enabling HTML Management Access

Edit the "$CATALINA_HOME/conf/tomcat-users.xml" file, adding the following entries inside "tomcat-users" tag. Adjust the password as required.

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="MyPassw0rd!" roles="manager-gui,admin-gui"/>

Restart Tomcat for the configuration to take effect.

$ $CATALINA_HOME/bin/shutdown.sh
$ $CATALINA_HOME/bin/startup.sh

The management application is now available from the "http://localhost:8080/manager/html" URL.

Deploying Applications

You can get a sample application WAR file to test with from "http://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/".

If this is a redeployment, delete the existing deployment from the "$CATALINA_HOME/webapps" directory.

# rm -Rf $CATALINA_HOME/webapps/sample

Place the "sample.war" file in the "$CATALINA_HOME/webapps" directory and Tomcat with automatically deploy it. You will see a "sample" directory appear.

You don't need to stop and start Tomcat for this to work, but you can if you want.

$ $CATALINA_HOME/bin/shutdown.sh
$ $CATALINA_HOME/bin/startup.sh

For more information see:

Hope this helps. Regards Tim...

Back to the Top.