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 ...
-
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...
-
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 ...
-
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...
-
Hmmm, So here's my new Baby !!! Afer using P800 for 1 year, I could move to no other phone except this P900. P900 – Simply smart...
-
BLIPPY ( http://www.blippy.com/ ) It looks lot like twitter. Works mostly like twitter. But its not another one of those social networking s...
-
Here comes another one. Tom Shinder's ISA Server 2004. I sometimes wonder, whether it is that i really like to collect books or is i...
-
Make money with NetBux ! All you need to do is use NetBux search instead of Google, and you can make hundreds of dollars a month!! A com...
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