Showing posts with label How to install apache tomcat on Linux. Show all posts
Showing posts with label How to install apache tomcat on Linux. Show all posts

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


                 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html


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  http://tomcat.apache.org/


                     # 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]

Operations:


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

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/
            # ./startup.sh


6. Access Tomcat in Browser


             http://localhost:8080/


7. Stop Tomcat


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


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