How to install tomcat 9?

I can't install tomcat 9 in ubuntu-15.10.Can anyone tell me the process how to install tomcat 9 in ubuntu-15.10?

1

3 Answers

You can find the instructions for install right here.

They run through 4 steps to install, with superseding steps to run tomcat. Here they are:

1. Verify Java

Tomcat 9 is designed to run on Java SE 8 or later. To check your version, run this command:

java -version

For instructions on installing java, visit this link.

2. Download Tomcat Archive

Download the archive using these commands or download it from tomcat's official download page.

cd /opt
wget
tar xzf apache-tomcat-9.0.0.M1.tar.gz
mv apache-tomcat-9.0.0.M1 tomcat9

3. Configure Environment Variables

Before starting, you'll have to define your CATALINA_HOME variable:

echo "export CATALINA_HOME="/opt/tomcat9"" >> /etc/environment
echo "export JAVA_HOME="/usr/lib/jvm/java-8-oracle"" >> /etc/environment
echo "export JRE_HOME="/usr/lib/jvm/java-8-oracle/jre"" >> /etc/environment
source ~/.bashrc

4. Setup User Accounts

In the terminal run:

sudo nano $CATALINA_BASE/conf/tomcat-users.xml

and add the following lines between the <tomcat-users> and </tomcat-users> open and close 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" />

Hope it works!

0

The link of the mirror provided in tecadmin site might not always work. It gave 404 when I tried to download.

However, the archive always works. Open this link and download your preferred file. There is a documentation at the end of this page, explaining what are the purpose of each of the files.

For ubuntu users:

  1. download the .zip/.tar.gz file from the archive,
  2. extract it in your desired location,
  3. update manager roles in {tomcat-base-dir}/conf/tomcat-users.html(see this link for help).

Hope this works.

You can get the perfect installation guide here:

Easy Guide to Install Apache Tomcat 9 on Ubuntu 18.04 / 16.04 LTS Server

NOTE:

This link has instructions for apache-tomcat-9.0.10.tar.gz. Be sure to follow instructions for the latest version.

Remember that after after downloading and extracting apache-tomcat-9.0.*.tar.gz change the folder name from apache-tomcat-9.0.* to tomcat or just move all contents of apache-tomcat-9.0.*.tar.gz to /opt/tomcat/

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like