Home » Linux Host, Ubuntu, SysAdmin » System Administration, Security » How to Install Apache Tomcat on Ubuntu ?

How to Install Apache Tomcat on Ubuntu ?

The Apache Tomcat® software is an open source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. Apache Tomcat software powers numerous large-scale, mission-critical web applications across a diverse range of industries and organisations.

$ sudo apt-get install openjdk-8-jdk

Downoad apache tomcat 8 from website https://tomcat.apache.org/download-80.cgi , this can be downloaded as below,

$ wget -c https://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.53/bin/apache-tomcat-8.5.53.tar.gz
$ tar xvf apache-tomcat-8.5.53.tar.gz
$ mv apache-tomcat-8.5.53 tomcat

Now, we need to export the following parameters, for this we can create the script as,

$ vim setenv.sh
#!/bin/bash
TOMCAT_DIR=$PWD/tomcat

export CATALINA_BASE=$TOMCAT_DIR
export CATALINA_HOME=$TOMCAT_DIR
export CATALINA_TMPDIR=$TOMCAT_DIR/temp/

we need to source the paramaters as,

$ source setenv.sh

Now, we can start the tomcat server as,

$ bash $PWD/tomcat/bin/startup.sh

Now the server is up and running at http://localhost:8080/

This server can be stopped as,

$ bash $PWD/tomcat/bin/shutdown.sh

Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment