The results and ramblings of research

phewww!

Tomcat 7 on CentOS 5.4

leave a comment »

Finally Tomcat 7 is here. Support for Servlet 3.0 and JSP 2.2 is finally here. Installation is a breeze as well. Here are my step. Please make sure you have the Sun JDK install. For more information on that please refer to my post.

# Download Tomcat 7
$ wget http://www.eng.lsu.edu/mirrors/apache/tomcat/tomcat-7/v7.0.14/bin/apache-tomcat-7.0.14.tar.gz
# Move the file to a install location
$ mv apache-tomcat-7.0.14.tar.gz /opt/
# Move wd to installation directory
$ cd /opt
# Decompress the folder
$ tar -xzf apache-tomcat-7.0.14.tar.gz   
# Remove compressed folder
$ rm -rf apache-tomcat-7.0.14.tar.gz   
# Tomcat 7 init scripts need to configured. Please copy the next codeblock in here.
$ vi /etc/init.d/tomcat7
# Change permissions to execute script
$ chmod a+x tomcat7
# Add service to list
$ /sbin/chkconfig --add tomcat7  
# Ensure runlevels 35 start script
$ /sbin/chkconfig --levels 35 tomcat7 on  
# Start Tomcat
$ /sbin/service tomcat7 start 

The init.d “tomcat7” script

#!/bin/bash
# description: Tomcat7 Start Stop Restart
# processname: tomcat7
# chkconfig: 35 20 80
JAVA_HOME=/usr/java/default
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/opt/apache-tomcat-7.0.14
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;; 
stop)   
sh $CATALINA_HOME/bin/shutdown.sh
;; 
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;; 
esac    
exit 0
Advertisements

Written by anujjaiswal

June 14, 2011 at 11:01 pm

Posted in Linux, Tomcat

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: