Monday, 19 September 2016

How to install apache tomcat on Linux

Apache Tomcat is an opensource web server that is developed by Apache software foundation.
It is bascically used for deploying java web application. It is run on port 8080.

1. Download jdk-version.tar.gz from


2. Extract the downloaded jdk.

                   # tar -xzf jdk-version.tar.gz

3. Set environmental variable.

                    Edit vim .bash_profile  --->  export PATH=(path of jdk bin):$PATH  (in centos,redhat....) 
           Edit vim .profile           --->  export PATH=(path of jdk bin):$PATH  (in ubuntu,mint....)

4. Download and Extract Tomcat Archive

                     # tar -xzf apache-tomcat-(version).tar.gz

Tar is a linux command used to create or extract .tar.gz file formats. Tar stands for tape archive. It is an archiving file format.

Tar synopsis

                       tar <operation> [options]


[-]A --catenate --concatenate
[-]c --create
[-]d --diff --compare
[-]r --append
[-]t --list
[-]u --update
[-]x --extract --get

Common Options:

-C, --directory DIR
-f, --file F
-j, --bzip2
-p, --preserve-permissions
-v, --verbose

-z, --gzip

5. Start Tomcat

            # cd /apache-tomcat-(version)/bin/
            # ./

6. Access Tomcat in Browser


7. Stop Tomcat

            # cd /apache-tomcat-(version)/bin/
            # ./

8. Setup User Accounts

             Edit "conf/tomcat-users.xml" file and paste inside <tomcat-users> </tomcat-users> tags.

<role rolename="manager-gui" />
<user username="manager" password="YOUR_PASSWORD_" roles="manager-gui" />

11. Restart the tomcat server

No comments:

Post a Comment