Instead of manually starting Tomcat each time, you can configure it to start at boot.
1. Save tomcat start / stop script
Copy and paste the following script into your text editor:
###############################################
# This is the init script for starting up the
# Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#
# Source function library.
. /etc/rc.d/init.d/functions
# Get config.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
tomcat=/usr/local/jakarta-tomcat
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
export JAVA_HOME=/usr/local/jdk
start(){
echo -n $"Starting Tomcat service: "
#daemon -c
$startup
RETVAL=$?
echo
}
stop(){
action $"Stopping Tomcat service: " $shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
# See how we were called.
case "" in
start)
start
;;
stop)
stop
;;
status)
# This doesn't work ;)
status tomcat
;;
restart)
restart
;;
*)
echo $"Usage: @@@SMARTY:TRIM:PRE@@@ {start|stop|status|restart}"
exit 1
esac
exit 0
##############################
############ end ############
Edit the lines that start with tomcat and export to match where you installed tomcat and jdk.
I am not the original creator if this script and i got it through a friend. I modified it a little to work in my case.
2. Save to /etc/init.d and chmod
Save the edited file above to /etc/init.d directory as "tomcat" or any other name you want. Now allow execute access to the script.
3. chmod a+x tomcat
4. Add to appropriate run level directories
chkconfig --add tomcat
chkconfig tomcat on
Thats it. You might want to see which run levels you want to add this.
About Me
Popular Posts
-
If you are constantly getting that "the original item cannot be found" error when you try to connect to a windows 2003 server from...
-
What a wonderful weekend it was... Movies, shopping, sleep, TV, and a nice drive throught the city to Queens and back - Mitsubishi Eclipse...
-
70-293 - Windows Server 2003 Network Infrastructure. Well, out of the 3 tests left for my MCSE 2003, this is the one i am currently working ...
-
Scanbuy Inc in Fortune Top 25 Breakout Companies of 2005 Guys, this is one cool company where i work as a systems/network administrator. I ...
-
I am back blogging after a long time now. Well, just bored and tired from reading about Exchange so took a break. Exchange 2003 , the lastes...
-
BLIPPY ( http://www.blippy.com/ ) It looks lot like twitter. Works mostly like twitter. But its not another one of those social networking s...
-
SMTP email allows any computer to send an e-mail claiming to be from anyone. Thus, it is easy for spammers to send e-mail from forged addres...
-
To zip and unzip files under linux, you need to install zip and unzip programs. These can be installed by # apt-get install zip # apt-get in...
-
After trying everything, giving all permissions, trying different ftp servers, on windows and on linux, if you can connect and read but stil...
-
1. With Windows 2003 you can now connect to the console session of a server meaning you actually have 3 connections available when running i...
ADs
Video of the day
About Me
- @man!
- I am a Systems/Network Administrator for 5 years, currently working for Scanbuy Inc,in Manhattan, NY.
No comments:
Post a Comment