0% found this document useful (0 votes)
53 views2 pages

Tomcat 7 Version

The document provides instructions for installing and configuring Tomcat 7 on a Linux server. It describes downloading the Tomcat tarball, extracting and moving it to the shared directory. It then creates an init script to start, stop, and restart Tomcat as a service, defining the JAVA_HOME environment variable and adding permissions and chkconfig settings. Finally it shows how to control the Tomcat service.

Uploaded by

Davina Cole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

Tomcat 7 Version

The document provides instructions for installing and configuring Tomcat 7 on a Linux server. It describes downloading the Tomcat tarball, extracting and moving it to the shared directory. It then creates an init script to start, stop, and restart Tomcat as a service, defining the JAVA_HOME environment variable and adding permissions and chkconfig settings. Finally it shows how to control the Tomcat service.

Uploaded by

Davina Cole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Download tomcat 7 version:

curl http://apache.mirrors.tds.net/tomcat/tomcat-7/v7.0.42/bin/apachetomcat-7.0.42.tar.gz | tar xvz

move to share directory


mv apache-tomcat-7.0.42 /usr/share/

create script for tomcat


vi /etc/init.d/tomcat

and add the follow lines...


#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.7.0_25
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/apache-tomcat-7.0.42
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
where JAVA_HOME is your path
[root@~]# echo $JAVA_HOME
/usr/java/jdk1.7.0_25

Now, added permissions


[[email protected]]# chmod 755 tomcat
[[email protected]]# chkconfig --add tomcat
[[email protected]]# chkconfig --level 234 tomcat on

check with
[[email protected]]# chkconfig --list tomcat
tomcat
0:off
1:off
2:on

now run/stop/restart service

3:on

4:on

5:off

6:off

[[email protected]]# service tomcat start


[[email protected]]# service tomcat stop
[[email protected]]# service tomcat restart

You might also like