[lug] tomcat5.5 as daemon on FC4

Hugh Brown hugh at math.byu.edu
Mon Nov 21 10:07:19 MST 2005



On Sun, 20 Nov 2005, D. Stimits wrote:

> ...
> >>DAEMON_HOME=/usr/local/tomcat5
> ...
> >>$DAEMON_HOME/bin/jsvc \
> >>-Djava.endorsed.dirs=$DAEMON_HOME/common/endorsed \
> ..
> >
> >
> > I just looked a little closer.  export'ing the CLASSPATH wouldn't serve
> > any purpose.  I did look at a jsvc startup script that I modified for a
> > friend and I had DAEMON_HOME set to $CATALINA_HOME/bin instead of just
> > to the $CATALINA_HOME that you have set.
>
> Originally it was set to this. It failed this way as well. I used this
> value because of what I found on a web page. Unfortunately, if I look at
> the location of common/endorsed/, it is directly under $CATALINA_HOME,
> and is not visible from the bin subdirectory. Removing the bin/ from
> this actually reduced the number of errors. One thing I wonder about
> though, the common/endorsed/ subdirectory has no other files in it.
> Maybe something there is required?
>

I just downloaded the 5.5.12, untarred it to /var/tmp, cd
/var/tmp/apache-tomcat-5.5.12/bin, untarred jsvc.tar.gz, cd jsvc-src,
chmod 700 configure,  ./configure --with-java=/usr/java/jdk1.5.0_05, make,
cp jsvc binary to $CATALINA_HOME/bin, edit Tomcat5.sh, chmod 700
Tomcat5.sh

and then ./Tomcat5.sh and it started.

contents of Tomcat5.sh (not including most comments):

JAVA_HOME=/usr/java/jdk1.5.0_05
CATALINA_HOME=/var/tmp/apache-tomcat-5.5.12
DAEMON_HOME=/var/tmp/apache-tomcat-5.5.12/bin
TOMCAT_USER=hugh

# for multi instances adapt those lines.
TMP_DIR=/var/tmp
PID_FILE=/var/tmp/jsvc.pid
CATALINA_BASE=$CATALINA_HOME

CATALINA_OPTS=""
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
  start)
    #
    # Start Tomcat
    #
    $DAEMON_HOME/jsvc \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -Dcatalina.home=$CATALINA_HOME \
    -Dcatalina.base=$CATALINA_BASE \
    -Djava.io.tmpdir=$TMP_DIR \
    -wait 10 \
    -pidfile $PID_FILE \
    -outfile $CATALINA_HOME/logs/catalina.out \
    -errfile '&1' \
    $CATALINA_OPTS \
    -cp $CLASSPATH \
    org.apache.catalina.startup.Bootstrap
    #
    # To get a verbose JVM
    #-verbose \
    # To get a debug of jsvc.
    #-debug \
    exit $?
    ;;

  stop)
    #
    # Stop Tomcat
    #
    $DAEMON_HOME/jsvc \
    -stop \
    -pidfile $PID_FILE \
    org.apache.catalina.startup.Bootstrap
    exit $?
    ;;

  *)
    echo "Usage tomcat.sh start/stop"
    exit 1;;
esac




More information about the LUG mailing list