How to install tomcat 8 on Centos / Fedora

How to install tomcat 8 on Centos/RHEL 6/7

Apache Tomcat, often referred to as Tomcat, is an open-source web server developed by the Apache Software Foundation(ASF). Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a “pure Java” HTTP web server environment for Java code to run in.

Tomcat is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation, released under the Apache License 2.0 license, and is open-source software.

install tomcat 8 on centos

Prerequisites for tomcat 8

  1. Update your system by using following command

yum -y update

2. Install Java

For installing tomcat we need to install jdk 7 or 8.

Download Tomcat 8

Now we download tomcat 8 from apache website use the following link download via command line:

cd  /opt/

Now extract the tomcat

tar xvf apache-tomcat-8.0.30.tar.gz
mv apache-tomcat-8.0.30 tomcat

Read Also: How to install glusterfs on centos 7

Configure web Interface

For accessing the tomcat web interface we need to set login and password. so, we will edit tomcat-users.xml for adding user and password..

cd /opt/tomcat/conf/

Edit the tomcat-users.xml file with your favourite editor

vi tomcat-users.xml

Now add the user ‘admin’ with password ‘password’. Add the following line in <tomcat-users> </tomcat-users> tag as follows
<user username="admin" password="password" roles="manager-gui,admin-gui"/>

This will add user for manager-gut and admin-gui.

Now start services of tomcat 8

cd /opt/tomcat/bin

 Access the Web Interface

Now we will access the web interface of our tomcat web server by the IP address of the server with port 8080.                Open your web browser and go to the following link and change ipaddress with your IP.

You will get apache tomcat page.

Screen Shot 2016-01-22 at 1.03.46 PM

Now you start deploying your java apps on tomcat server..

If you have any issue using this tutorial feel free to comment below..

Leave a Reply

Your email address will not be published.


The reCAPTCHA verification period has expired. Please reload the page.

48-Hour Flash Sale! Courses from just $10.99