How to Install Apache Tomcat 8 on Linux?
Last Updated :
06 Oct, 2021
Apache Tomcat (short for "Tomcat") is a free and open-source Java Servlet, JavaServer Pages, Java Expression Language, and WebSocket implementation. [two] Tomcat is an HTTP web server that runs Java code in a "pure Java" environment.
Tomcat is developed and maintained by a free group of developers under the Apache Software Foundation's auspices and is licensed under the Apache License 2.0. In this article, we are going to see how to install Apache Tomcat 8 on Linux systems.
Installing Apache Tomcat 8:
Create a directory named tomcat in the /opt folder:
$ mkdir /opt/tomcat
Create a directory
Change directory to tomcat:
$ cd /opt/tomcat
Change directory to tomcat
Go to the Apache Tomcat 8 Download page by clicking this link. Place your cursor under 8.5.65 Binary Distributions, right-click on the tar file and select the copy link address from the menu that appears (as shown in the picture below). At the time of writing, Tomcat 8 is the most recent edition, but you are free to use whatever version is most current.
Next, use the wget command to download the tar from the URL you copied in the previous stage to the tomcat folder on your server:
$ sudo wget https://apachemirror.wuchna.com/tomcat/tomcat-8/v8.5.65/bin/apache-tomcat-8.5.65.tar.gz
Decompress the file in your tomcat folder after it has finished downloading:
$ tar xvzf apache-tomcat-8.5.65.tar.gz
Decompress the fileInstalling Java:
You must first install the Java Development Kit before you can use Tomcat (JDK). Check to see if Java is installed first:
$ apt-get install default-jdk
Installing the Java Development Kit
Now verify java installed properly:
$ java -version
Verify java installed properlyConfigure .bashrc File:
Use the following command to set the environment variables in .bashrc:
$ nano ~/.bashrc
Add the following lines to the file's end:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export CATALINA_HOME=/opt/tomcat/apache-tomcat-8.5.65
After you've saved your changes and exited the .bashrc file, run the following command to make the changes take effect:
$ . ~/.bashrc
Your server should now have Tomcat and Java enabled and configured. Run the following script to start Tomcat:
$ $CATALINA_HOME/bin/startup.sh
In a web browser, go to YourIPAddress:8080 to see if Tomcat is up and running. http://127.0.0.1:8080, for example.
Similar Reads
How to Install Apache Tomcat on Windows? Apache Tomcat which is short for âTomcatâ is a free, open-source Java Servlet, Java Expression Language, JavaServer Pages, and WebSocket implementation. Tomcat is an HTTP web server that basically runs Java code in a âpure Javaâ environment. Here, we will see how to install Tomcat 10 on Windows 10 f
3 min read
How to Install Apache JMeter on Linux? Apache JMeter is an open-source tool designed for load testing and performance measurement. Itâs widely used by developers and testers for analyzing and measuring the performance of web applications. Here, we will learn the process of installing Apache JMeter on Ubuntu, a popular Linux distribution
3 min read
How to Install Tor on Linux? Tor browser is a web browser that is designed and developed to protect your privacy online and is mostly famous among normal people as a key for safely accessing hidden or restricted online resources, including those on the dark web. We will see what Tor is and how to install it on your Linux machin
5 min read
How to Install Apache Pig in Linux? Pig is a high-level platform or tool which is used to process large datasets. It provides a high-level of abstraction for processing over the MapReduce. It provides a high-level scripting language, known as Pig Latin which is used to develop the data analysis codes. In order to install Apache Pig, y
2 min read
How to Install Apache Maven on Windows? Apache Maven is an automation tool. The tool is written in Java. It was initially released on 13 July 2004. It is developed by the Apache software foundation. It is part of the Jakarta Project. It is working on two aspects: how software is built, and its dependencies. It was created by Jason van Zyl
3 min read