Software Development & Operating Systems

Notes on Software Development & Operating Systems

Install Tomcat 6 on Fedora

Prerequisites:

Install Java JDK on CentOS

Follow these steps to install Tomcat 7 on CentOS.

Tomcat 6 will be installed in /usr/local/tomcat

Login or su as root:

su root

Create Tomcat Group and User:

groupadd tomcat

useradd -g tomcat -s /sbin/nologin -d /opt/tomcat/temp tomcat

Create and Change directory to the install directory

cd /usr/local

mkdir tomcat

cd tomcat

Download the distribution:

wget http://apache.hoxt.com/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.tar.gz

Extract the distribution:

tar xvzf apache-tomcat-6.0.33.tar.gz

Change ownership to user tomcat:

cd apache-tomcat-6.0.33

chown -R tomcat:tomcat *

NOTE: When starting and stopping tomcat be sure to do it as the tomcat user!

cd /usr/local/tomcat/apache-tomcat-6.0.33/bin

sudo -u tomcat ./startup.sh

-or-

sudo -u tomcat ./shutdown.sh

 If by chance you forget, and start or stop as root instead then go back and repeat the step to change ownership to user tomcat.

Tags: , ,