ORACLE-BASE - Apache Tomcat 10 Installation On Linux (RHEL and Clones)
ORACLE-BASE - Apache Tomcat 10 Installation On Linux (RHEL and Clones)
8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23ai | 24ai | Misc | PL/SQL | SQL | RAC | WebLogic |
Linux
Home » Articles » Linux » Here
Downloads
Installation
Checking the Status of Tomcat
Configuration Files
Enabling HTML Management Access
Deploying Applications
Java and Tomcat Upgrades
Related articles.
Downloads
Download the following software. This article assumes these downloads are present in the "/tmp"
directory on the server.
Installation
Create a user called "tomcat" to own the Tomcat installation. We also create a directory called
"/u01" to hold all the config, and make sure that it owned by the new "tomcat" user.
# useradd tomcat
# mkdir -p /u01
# chown tomcat:tomcat /u01
https://oracle-base.com/articles/linux/apache-tomcat-10-installation-on-linux 1/5
4/11/25, 11:46 PM ORACLE-BASE - Apache Tomcat 10 Installation on Linux (RHEL and clones)
Install the JDK from the tarball under the "/u01/java" directory. We unzip it to create a new
directory, which includes the version number, but use a symbolic link so we can always use the
same path for the JAVA_HOME environment variable, regardless of the version.
# su - tomcat
$ mkdir -p /u01/java
$ cd /u01/java
$ tar xzf OpenJDK11U-jdk_x64_linux_hotspot_11.0.11_9.tar.gz
$ ln -s jdk-11.0.11+9 latest
Install Tomcat from the tarball under the "/u01/tomcat" directory. We unzip it to create a new
directory, which includes the version number, but use a symbolic link so we can always use the
same path for the CATALINA_HOME environment variable, regardless of the version.
$ mkdir -p /u01/tomcat
$ cd /u01/tomcat
$ tar xzf /tmp/apache-tomcat-10.0.6.tar.gz
$ ln -s apache-tomcat-10.0.6 latest
We want to separate the config from the binaries, to make future upgrades easier, so we will
create a new directory to act as the CATALINA_BASE location, and seed it by copying the relevant
directories to the new directory. We are using a sub-directory called "instance1" to allow for
multiple instances, but that is not necessary if you only plan to have a single Tomcat instance
running.
$ mkdir -p /u01/config/instance1
$ cp -r /u01/tomcat/latest/conf /u01/config/instance1/
$ cp -r /u01/tomcat/latest/logs /u01/config/instance1/
$ cp -r /u01/tomcat/latest/temp /u01/config/instance1/
$ cp -r /u01/tomcat/latest/webapps /u01/config/instance1/
$ cp -r /u01/tomcat/latest/work /u01/config/instance1/
Set the following environment variables and append them to the "/home/tomcat/.bash_profile" so
they are set for subsequent logins.
export JAVA_HOME=/u01/java/latest
export CATALINA_HOME=/u01/tomcat/latest
export CATALINA_BASE=/u01/config/instance1
$ $CATALINA_HOME/bin/startup.sh
$ $CATALINA_HOME/bin/shutdown.sh
https://oracle-base.com/articles/linux/apache-tomcat-10-installation-on-linux 2/5
4/11/25, 11:46 PM ORACLE-BASE - Apache Tomcat 10 Installation on Linux (RHEL and clones)
Once Tomcat is started, the following URL should be available. Configuration for the management
URLs is discussed below.
http://localhost:8080/
http://localhost:8080/manager/html
http://localhost:8080/manager/status
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.
$ curl -I http://localhost:8080
HTTP/1.1 200
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Fri, 04 Jun 2021 20:19:38 GMT
Configuration Files
The main locations of configuration and log information are shown below.
https://oracle-base.com/articles/linux/apache-tomcat-10-installation-on-linux 3/5
4/11/25, 11:46 PM ORACLE-BASE - Apache Tomcat 10 Installation on Linux (RHEL and clones)
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="MyPassw0rd!" roles="manager-gui,admin-gui"/>
$ $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-
10.0-doc/appdev/sample/".
# rm -Rf $CATALINA_BASE/webapps/sample
Place the "sample.war" file in the "$CATALINA_BASE/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
In the following example shows how you would do this, but clearly you would have to alter the
version numbers.
$CATALINA_HOME/bin/shutdown.sh
cd /u01/java
tar xzf OpenJDK11U-jdk_x64_linux_hotspot_11.0.11_9.tar.gz
https://oracle-base.com/articles/linux/apache-tomcat-10-installation-on-linux 4/5
4/11/25, 11:46 PM ORACLE-BASE - Apache Tomcat 10 Installation on Linux (RHEL and clones)
rm latest
ln -s jdk-11.0.11+9 latest
Apache Tomcat
Apache Tomcat 8 Installation on Linux (RHEL and clones)
Apache Tomcat 9 Installation on Linux (RHEL and clones)
Apache Tomcat : Enable HTTPS
Contact Us
Home | Articles | Scripts | Blog | Certification | Videos | Misc | About
https://oracle-base.com/articles/linux/apache-tomcat-10-installation-on-linux 5/5