I've edited the /etc/rc.d/init.d/httpd for autostart the tomcat when the
apache starts, and shutdown it, when the apache stops, thinking on a RedHat
7 machine, just do this:
1.- I installed tomcat on /var/tomcat, please change path to match your
system
2.- Created a file hello.sh, on /var/tomcat containing the following:
#! /bin/sh
TOMCAT_HOME=/var/tomcat/
JAVA_HOME=/usr/java/jdk1.3/
export TOMCAT_HOME JAVA_HOME
3.- Edit /etc/rc.d/init.d/httd. In the part:
start() {
# Here we will start the tomcat
# I did this file to set the environment variables
source /var/tomcat/hello.sh
# Now for the tomcat
echo -n "Arrancando tomcat"
/var/tomcat/bin/startup.sh
# End of the place to edit
echo -n "Starting httpd: "
...
}
4.- In the same file, in the part:
stop() {
...
echo "Apagando tomcat"
/var/tomcat/bin/shutdown.sh
...
}
When you restart the httpd service, the tomcat stop and start
simultaneosly.
On RedHat 6.x, you've to do something like this on the start) and stop)
parts of the file
Good luck, this worked for me, but I think we all must be aware that any
upgrade of apache will override this changes, keep the changes in a file to
make cut paste when this will occurs.
Pau
---
Col.legi Oficial de Metges de Barcelona (COMB)
Dept. Internet (METGES on line)
web: http://www.comb.es e-mail: [EMAIL PROTECTED]
Placa Francesc Macia, 4,1er 2a
08021 Barcelona
Tel.: 93/362 08 50 Fax.: 93/414 22 22
---
-Mensaje original-
De: Rikard Westlund [SMTP:[EMAIL PROTECTED]]
Enviado el: miercoles 10 de enero de 2001 14:40
Para: '[EMAIL PROTECTED]'
Asunto: SV: autostart from apache
From the userguide
"Instruct jserv not to start the Tomcat process. Automatically starting
Tomcat is not implemented yet. "
-Ursprungligt meddelande-
Fran: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Skickat: den 10 januari 2001 14:20
Till: [EMAIL PROTECTED]
Amne: autostart from apache
Just one little question. can i start tomcat from apache like jserv? i've
compile mod_jk and add LoadModule directive in httpd.conf. but any
servlets not working until i start tomcat manually...
--
E-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]