How to install Apache tomcat on Linux?

By | August 11, 2013

How to install Apache tomcat on Linux

apache_tomcat_linuxbrainboxApache Tomcat is an open source web application server which supports J2ee Servlets, JavaServer, Pages(JSP) and API’s. Tomcat should not be confused with Apache web server which is an HTTP web server.

Apache Tomcat can be configured by editing server.xml file.

Servlet is defined as a way to add dynamic content to a Web server using the Java platform & a servlet container is a compiled, executable program. The servlet container name in tomcat is catalina.

Prerequisites for installing Apache tomcat are
1. Java
2. JDK

Steps to install Apache tomcat

Step1 : Install all the prerequisites

Redhat :

#yum install java

Step2 : Download tomcat source package and un compress it.

#cd /opt

#tar xvfz apache-tomcat-8.0.0-RC1.tar.gz

Step3 : Setup the paths for Catalina and others.
Setting catalina paths



Setting java paths

Check what java versions are installed in your system

#update-alternatives –config java

This command will display which is default java version used by your machine.

Example output :

# update-alternatives –-config java

There are 2 programs which provide ‘java’.

Selection Command
*+ 2

Enter to keep the current selection[+], or type selection number:

If you see above the default java version is 1.6 so set the path to/usr/lib/jvm/jre-1.6.0-openjdk


Step4 : Now start tomcat server


Sample output.

Using CATALINA_BASE: /opt/apache-tomcat-8.0.0-RC1
Using CATALINA_HOME: /opt/apache-tomcat-8.0.0-RC1
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.0-RC1/temp

Step5 : By default Apache Tomcat will be hosted on localhost : 8080 port by default. So try to access the site with web browser


Leave a Reply

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