tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Rumney <jrum...@att.com>
Subject Re: Sys V Init & tomcat
Date Wed, 09 Aug 2000 07:42:39 GMT
David Mann <Davidm@invera.com> writes:

> Hello,
>  
> Trying to get an Sys V Init config for tomcat with no success (Newbie to
> linux/Unix)
>  
> I've got jacarta-tomcat 3.2 up and running with Red Hat 6.2 Apache 1.3.12
> using mod_jk without incident.  I've added .tomcatrc to /root for JAVA_HOME,
> TOMCAT_HOME and some TOMCAT_OPTS (a few system properties we use in our
> apps).  Logging in as root and firing up tomcat.sh (startup.sh) works fine.
>  
> However moving tomcat.sh to the init.d directory (/etc/rc.d/init.d/tomcat)
> and adding a symlink (S85tomcat, K85tomcat) doesn't seem to do the trick and
> there's no log evidence to go on.

Provided you made the links in the correct place (rc0.d and rc1.d for
K85tomcat, and rc2.d for S85tomcat) this should work.

However, I don't think it is a good idea to run Tomcat as root on a
live system. A better approach would be to write a script which runs
tomcat via "su". If you require access on port 80, use Apache and
mod_jserv, as Apache is capable of doing a setuid to a non-priviledged
user after opening the port.

Here is my startup script for Tomcat/Apache:

#!/bin/sh
##################################################################

case $1 in
'start')
    su - wwwuser -c "/usr/local/jakarta-tomcat/bin/startup.sh"
    sleep 10
    /usr/local/apache/bin/apachectl start
    ;;

'stop')
    /usr/local/apache/bin/apachectl stop
    su - wwwuser -c "/usr/local/jakarta-tomcat/bin/shutdown.sh"
    ;;

*)
    echo "usage: $0 {start|stop}"
    ;;
esac

###################################################################



-- 
Jason Rumney <jrumney@att.com>
AT&T Labs (Redditch, UK)


Mime
View raw message