How to install Apache Tomcat on CentOS 6.3 in few steps

[easyazon-link asin=”0471753610″ locale=”us”] Apache Tomcat [/easyazon-link] is an open source software implementation of the Java Servlet and JavaServer Pages technologies. Different versions of [easyazon-link asin=”1849516626″ locale=”us”] Apache Tomcat [/easyazon-link]are available for different versions of the Servlet and JSP specifications. Latest version is Apache Tomcat 7.x. However I will here show and focus on installation of [easyazon-link asin=”1847197280″ locale=”us”] Apache Tomcat 6 [/easyazon-link] on [easyazon-link asin=”1430219645″ locale=”us”] CentOS [/easyazon-link]Linux server. Installation is very easy, basically as long as you have installed Java on system you should be able to quickly install and configure Apache Tomcat 6 on your Linux [easyazon-link asin=”1430219300″ locale=”us”] CentOS 6.3 [/easyazon-link] server in few steps.

  • switch to root
  • install Java
  • verify that Java is installed and present on your machine
yum install -y java
java -version

Next steps are involving to install the Apache Tomcat6:

yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps
cd /etc/init.d
./tomcat6 start

Once you have installed and started the [easyazon-link asin=”B007NXNSE2″ locale=”us”] Apache Tomcat [/easyazon-link] server go to your browser and confirm you have running Tomcat 6 on your server by entering http://localhost:8080  – Apache Tomcat6 uses default port 8080. You can change this latter if you wish.

Here is list and path to important configuration files for Apache Tomcat

/etc/tomcat6 (main tomcat config files reside)
/var/lib/tomcat6 (where you will add and/or change most of your files)

If you wish to change the default port 8080 to different unused port you need to change this part in server.xml

gedit /etc/tomcat6/server.xml

scroll down and edit this part in the file:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>

Once done, save changes and restart the Apache Tomcat and you should be able now access it on new port.

How to create admin password for Apache Tomcat:

  • Edit /etc/tomcat6/tomcat-users.xml 
  • Add the following
 <!--  <role rolename="role1"/>    -->    
<!--      -->

[nggallery id=23]
[easyazon-image align=”none” asin=”1430237236″ locale=”us” height=”160″ src=”” width=”130″]

Leave a Reply