How to install apache tomcat in ubuntu?

00)Prerequisite

Make sure you have installed the java in your ubuntu machine and set the JAVA_HOME variable.

01) Download the binary zip file of the apache tomcat latest version. download the tar.gz file in the following link

https://tomcat.apache.org/download-60.cgi

02) Then uncompress  the zip file and move it to the directory you want

03) Set the CATALINA_HOME environmental variable

export CATALINA_HOME=/path/to/tomcat/installation 

 (#eg./opt/tomcat7 )

03)Start the tomcat server

There are two ways to start the tomcat server in Ubuntu

I)Via an environment variable

Set an environment variable CATALINA_HOME to the path of the directory into which you have installed Tomcat

 Execute the shell command

$CATALINA_HOME/bin/startup.sh

II) By modifying your current working directory

In this method you have to go to the bin of the tomcat folder by the terminal and run the startup.sh file

Execute the following shell commands

cd PathTOTheTomcatDirectory/bin

./startup.sh

After startup, the default web applications included with Tomcat will be available by browsing:

http://localhost:8080/

Further information about configuring and running Tomcat can be found in the documentation included here, as well as on the Tomcat web site: http://tomcat.apache.org/

04) Shut Down Tomcat

There are two techniques by which Tomcat can be stopped:

I)Via an environment variable

Set an environment variable CATALINA_HOME to the path of the directory into which you have installed Tomcat

 $CATALINA_HOME/bin/shutdown.sh

II)By modifying your current working directory

Execute the following shell commands

cd $CATALINA_HOME/bin

 ./shutdown.sh 

1 thought on “How to install apache tomcat in ubuntu?

  1. Pingback: How to run apache tomcat in debug mode (Ubuntu)? | Tharindu's Techz

Leave a comment