Configure Apache tomcat server on RHEL & CentOS

Apache Tomcat is an open source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Oracle and provides a “pure Java” HTTP web server environment for running the Java codes.  Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files.

Tomcat server Scenario-

OS-       Centos 6.5

Step- 1 

1- Change IP Address..

[root@server ashutosh]# vim /etc/sysconfig/

2- Restart Network Service..

[root@server ashutosh]# service network restart
[root@server ashutosh]# ifconfig

Step-2 Install OpenJDK

[root@pc ~]# yum install java* -y

[root@pc ~]# java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (rhel- u55-b13)
OpenJDK Client VM (build 24.51-b03, mixed mode, sharing)

Step-3 Download and Extract Tomcat Archive

[root@pc ~]# cd /tmp

[root@pc tmp]# wget

[root@pc tmp]# tar xzf apache-tomcat-7.0.54.tar.gz

[root@pc tmp]# mv apache-tomcat-7.0.54 /usr/local/tomcat7

[root@pc tmp]# cd /usr/local/tomcat7

[root@pc tomcat7]# ll

total 120
drwxr-xr-x. 9 root root  4096  Jun  24 09:23 apache-tomcat-7.0.54
drwxr-xr-x. 2 root root  4096  Jun  24 09:22 bin
drwxr-xr-x. 3 root root  4096  Jun  24 10:00 conf
drwxr-xr-x. 2 root root  4096  Jun  24 09:22 lib
-rw-r--r--.    1 root root 56812  May20 01:05 LICENSE
drwxr-xr-x. 2 root root  4096  Jun  24 09:24 logs
-rw-r--r--.    1 root root  1192  May 20 01:05 NOTICE
-rw-r--r--.    1 root root  8974  May 20 01:05 RELEASE-NOTES
-rw-r--r--.    1 root root 16204 May 20 01:05 RUNNING.txt
drwxr-xr-x. 2 root root  4096  Jun  24 09:22 temp
drwxr-xr-x. 7 root root  4096  May 20 01:03 webapps
drwxr-xr-x. 3 root root  4096  Jun  24 09:24 wo

Step-4 Start Tomcat

[root@pc tomcat7]# ./bin/

Using CATALINA_BASE:   /usr/local/tomcat7
Using CATALINA_HOME:   /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/tomcat7/bin/
Tomcat started.

Step-5 Access Tomcat in Browser

Step-6 Managing the Apache Tomcat

Tomcat can be managed through the web-manager, the following can be done through that.
Deploy new application, deploy new application on specified context, list the active or in active applications, start and stop the web applications.

Web manager is password protected, requires user name and password to access. Only the user with the “manager-gui” role is allowed to access, these users and roles are defined in tomcat-users.xml. By default “manager-gui” role not defined that file, we need to add it manually.

[root@pc tomcat7]# vi conf/tomcat-users.xml

Place the following two lines just above the last line.

<role rolename=”manager-gui”/>
<user username=”tomcat” password=”tomcat” roles=”manager-gui”/>

Stop and Start the tomcat, now tomcat user have access to the web manager.

Note- If You Want to define other role the click below link-

I Hope You Like It,
So Enjoy..


Click Back..                                Click Home..