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...
-
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...
-
What a wonderful weekend it was... Movies, shopping, sleep, TV, and a nice drive throught the city to Queens and back - Mitsubishi Eclipse...
-
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...
-
My Toys - Fuji S5100 4MP, 10X optical Zoom
-
This is one of the many problems i faced with Vista. File access on network shares was really slow. Shares took upto 5 minutes to show conte...
-
When you start (IIS) 6.0 on Microsoft Windows Server 2003, IIS binds to all IP addresses on the server, not just the IP addresses t...
-
Some shortcuts and commands.... if you are not a GUI person .. Accessibility Controls access.cpl Accessibility Wizard accwiz Add H...
-
BLIPPY ( http://www.blippy.com/ ) It looks lot like twitter. Works mostly like twitter. But its not another one of those social networking s...
-
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 ...
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