Home » Centos/RHEL » Install and Configure Apache Tomcat 8 on Centos/RHEL

Install and Configure Apache Tomcat 8 on Centos/RHEL

Apache tomcat is an open source web server application with generally works with java. This article will guide to install and Configure Apache Tomcat 8 on linux server such as Centos/RHEL. Apache tomcat generally used for java code. Apache tomcat provide more than security compairly other web server. Most of enterprises applications running from apache tomcat.
Apache Tomcat Requirement.
Apache Tomcat 8
Java with latest version.
Operating system Centos, ubuntu.

Download and Install java 8

[root@linuxpcfix ~]# cd /usr/local/
[root@linuxpcfix ~]#wget http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-linux-x64.tar.gz
[root@linuxpcfix ~]#tar -xvf jdk-8u20-linux-x64.tar.gz
[root@linuxpcfix ~]#ln -s jdk1.8.0_20/ java
[root@linuxpcfix ~]#export JAVA_HOME=”/usr/local/java”
[root@linuxpcfix ~]#cd /java
[root@linuxpcfix ~]#bin/java -version
bin/java -version
java version “1.8.0_20”
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

Download Install apache tomcat8

[root@linuxpcfix ~]# cd /usr/local/
[root@linuxpcfix ~]wget http://mirror.symnds.com/software/Apache/tomcat/tomcat-8/v8.0.14/bin/apache-tomcat-8.0.14.tar.gz
Connecting to download.oracle.com|184.50.238.26|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: “jdk-8u20-linux-x64.tar.gz”

100%[============================================================================================>] 5,812 –.-K/s in 0s

2014-10-05 23:00:46 (84.1 MB/s) – “jdk-8u20-linux-x64.tar.gz” saved [5,812/5,812]

[root@linuxpcfix ~]tar -xvf apache-tomcat-8.0.14.tar.gz
[root@linuxpcfix ~]ln -s apache-tomcat-8.0.14 tomcat
[root@linuxpcfix ~]cd tomcat
[root@linuxpcfix ~]bin/version.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/java
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.0.14
Server built: Sep 24 2014 09:01:51
Server number: 8.0.14.0
OS Name: Linux
OS Version: 2.6.32-358.el6.x86_64
Architecture: amd64
JVM Version: 1.8.0_20-b26
JVM Vendor: Oracle Corporation

[root@linuxpcfix ~]cd /usr/local/tomcat/bin/
[root@linuxpcfix ~]sh startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/java
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

As Apache tomcat by defauls listen on 8080 port so your prefered browser and access tomcat as http://server-ip-address:8080/ it will show as below.
tomcat

Now time to user management to access the apache tomcat gui interface

[root@linuxpcfix ~]cd /usr/local/tomcat/conf
[root@linuxpcfix ~]vi tomcat-users.xml
<!– 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” />

Enjoy!

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud