You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alejandro Arredondo <ba...@letodesigns.every1.net> on 2001/08/17 03:17:06 UTC

Tomcat 4 as a service under Linux

How can I add tomcat to run as a service under Linux and to work with apache?. I saw the script that starts apache at boot time and looks pretty confusing. Is there any way to add tomcat to that script to start before apache?
Thanks in advance

_____________________________________________________________
Free E-mail --->
http://letodesigns.mail.everyone.net
Letodesigns & Programming Free e-mail
6MB limit
http://letodesigns.8k.com

Re: Tomcat 4 as a service under Linux

Posted by Dmitri Colebatch <di...@bigpond.net.au>.
The /etc/rc.d/init.d scripts look complex, but there's really one very
simple line to them:

# chkconfig: 345 85 15

its the comment at the top of them all.  to get tomcat to start
automatically, try something like (note I haven't done this myself, so its
not guarenteed to work - but do ask):
 
1. copy tomcat.sh to /etc/rc.d/init.d/tomcat
2. edit the new tomcat script so that tomcat runs under the appropriate
user (as the /etc/rc.d scripts are called by root (su <user> -c "cmd")
3. at the top of the file add a comment like the one above.  the syntax of
the comment is:
   # chkconfig: <runlevels> <startorder> <stoporder>
you'll need it to start before apache, and start after... try
   # chkconfig: 345 84 16
4. run the command "chkconfig --add tomcat"
5. run the command "chkconfig --level 345 tomcat on"

that should have tomcat start automatically in runlevels 3 4 and 5.

hth,

cheesr
dim

On Thu, 16 Aug 2001, Alejandro Arredondo wrote:

> How can I add tomcat to run as a service under Linux and to work with apache?. I saw the script that starts apache at boot time and looks pretty confusing. Is there any way to add tomcat to that script to start before apache?
> Thanks in advance
> 
> _____________________________________________________________
> Free E-mail --->
> http://letodesigns.mail.everyone.net
> Letodesigns & Programming Free e-mail
> 6MB limit
> http://letodesigns.8k.com
> 


Re: Tomcat 4 as a service under Linux

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Alejandro Arredondo at babaji@letodesigns.every1.net wrote:

> How can I add tomcat to run as a service under Linux and to work with apache?.
> I saw the script that starts apache at boot time and looks pretty confusing.
> Is there any way to add tomcat to that script to start before apache?
> Thanks in advance

Be sure JAVA_HOME is set into your catalina.sh script and then link it down
to your rc.d directory.

    Pier