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...
-
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...
-
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...
-
After trying everything, giving all permissions, trying different ftp servers, on windows and on linux, if you can connect and read but stil...
-
What a wonderful weekend it was... Movies, shopping, sleep, TV, and a nice drive throught the city to Queens and back - Mitsubishi Eclipse...
-
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...
-
I installed Windows 7 on another partition to play around and then comes the time to let go of it.(i love it, but its trial version and i ca...
-
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 ...
-
I am tired of hearing that firefox is so cool and how it is the fastest, most secure, bla bla bla browser. Well after some research and look...
-
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...
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