Trending News

Blog

How to Install Tomcat 8.5 on Ubuntu, CentOS & LinuxMint Ultimate Guide
CentOS

How to Install Tomcat 8.5 on Ubuntu, CentOS & LinuxMint Ultimate Guide 

Apache Tomcat is a free and open-source web server for Java-based web applications. The Apache License version 2 pertains to Tomcat. On June 25, 2014,

Table of Contents

Install Tomcat 8.5

Apache published a stable version of Tomcat 8. Which can be downloaded from the company’s official website. Some functionalities of Apache Tomcat 8 have been improved. A few details concerning Tomcat 8 are shown below.

  • To run Tomcat 8, you’ll need Java 7 or higher.
  • Java Servlet 3.1 is supported by Tomcat 8.
  • JavaServer Pages 2.3 is supported by Tomcat 8.
  • Java Unified Expression Language 3.0 is supported by Tomcat 8.
  • Java WebSocket 1.0 is supported by Tomcat 8.
This guide will walk you through the process of installing Tomcat 8 on CentOS/RHEL and Ubuntu systems. The stable release of Tomcat 8 is now available for download. Install Tomcat 7 on CentOS/RHEL or Install Tomcat 7 on Ubuntu, depending on your operating system, to install various versions of Tomcat.

Step 1: Verify of Update the Installed Version of Java

The first requirement for Tomcat installation is JAVA. To see if you already have Java installed on your system, use the following command.

				
					# java -version

openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~16.04-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)
				
			

Tomcat 8 is compatible with Java SE 7 and later. As a result, double-check that you have the right version installed on your system. Use one of the following sites to install Java if you don’t already have it installed or have a lower version.

Step 2: Download Tomcat 8 Archive

Use the commands below to get the Apache Tomcat 8 archive file, or go to the Tomcat 8 official download page to get the most recent version. Extract the archive file to the /opt directory after it has been downloaded. This location can be changed to suit your needs.

				
					wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.51/bin/apache-tomcat-8.5.64.tar.gz
tar xzf apache-tomcat-8.5.64.tar.gz
mv apache-tomcat-8.5.64 /usr/local/tomcat8
				
			

Step 3: Configure CATALINA_HOME Environment Variable

Configure the CATALINA HOME environment variable on your system before launching Tomcat with the commands below.

				
					echo "export CATALINA_HOME="/usr/local/tomcat8"" >> ~/.bashrc
source ~/.bashrc
				
			

Step 4: Launch Tomcat Server

Tomcat is relatively simple to use, and its source does not need to be compiled. It’s as simple as extracting the package and launching the Tomcat server. As Tomcat starts on port 8080 by default, make sure no other applications are utilizing the same port.

				
					cd /usr/local/tomcat8
./bin/startup.sh

				
			

Output

				
					Using CATALINA_BASE:   /usr/local/tomcat8
Using CATALINA_HOME:   /usr/local/tomcat8
Using CATALINA_TMPDIR: /usr/local/tomcat8/temp
Using JRE_HOME:        /opt/jdk1.8.0_121
Using CLASSPATH:       /usr/local/tomcat8/bin/bootstrap.jar:/usr/local/tomcat8/bin/tomcat-juli.jar
Tomcat started.
				
			

Step 5: Access Tomcat 8 in Browser

The default port for the Tomcat server is 8080. Connect your server to port 8080 and use a web browser to access Tomcat.
				
					http://localhost:8080


				
			

Step 6: Create User Accounts

Finally, user accounts must be created in order to secure and access admin/manager pages. In your editor, open the conf/tomcat-users.xml file and paste within the and /tomcat-users> tags.

				
					<!-- user manager can access only manager section -->
<role rolename="manager-gui" />
<user username="manager" password="_SECRET_PASSWORD_" roles="manager-gui" />

<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="_SECRET_PASSWORD_" roles="manager-gui,admin-gui" />
				
			
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on reddit
Share on vk
Share on tumblr
Share on skype
Share on stumbleupon
Share on whatsapp
Share on email

Related posts

Leave a Reply

Required fields are marked *