5 Replies Latest reply on Nov 4, 2009 5:31 AM by Thomas Heute

    What I did to run GateIn-3.0.0-Beta02 tomcat with jsvc

    Brian Millett Newbie

      Well, this is what I did to get gatein b2 to work with the jsvc service


      First I really do not like relative pathnames. All of the "../temp/" in the configuration files is just a bogus hack. I hope that they will get cleaned up.


      I installed the GateIn-3.0.0-Beta02 under /opt and made a sym link to /opt/tomcat

      Had to make a sym link /opt/tomcat/temp to /opt/temp (see rant above)

      created a tomcat user.
      chowned the /opt/GateIn-3.0.0-Beta02 to tomcat
      compiled the /opt/tomcat/bin/jsvc.tar.gz source and installed it in /usr/local/bin

      Then used this init.d script to start / stop tomcat.

      __BEGIN__
      #!/bin/sh
      #
      # chkconfig: 345 86 15
      # description: Tomcat Server
      #
      # Small shell script to show how to start/stop Tomcat using jsvc
      # If you want to have Tomcat running on port 80 please modify the server.xml
      # file:
      #
      # <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->
      # <Connector className="org.apache.catalina.connector.http.HttpConnector"
      # port="80" minProcessors="5" maxProcessors="75"
      # enableLookups="true" redirectPort="8443"
      # acceptCount="10" debug="0" connectionTimeout="60000"/>
      #
      #
      # Adapt the following lines to your configuration
      JAVA_HOME=/usr/jdk
      CATALINA_HOME=/opt/tomcat
      CATALINA_BASE=/opt/tomcat
      DAEMON_HOME=/usr/local/bin
      TOMCAT_USER=tomcat
      PIDFILE=/var/run/jsvc.pid
      TMP_DIR=$CATALINA_BASE/temp
      LOG_OPTS="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog"
      SECURITY_OPTS="-Djava.security.auth.login.config=$CATALINA_HOME/conf/jaas.conf"
      EXO_OPTS="-Dexo.product.developing=false"

      CATALINA_OPTS=" -Djava.library.path=/usr/local/lib
      -Djava.awt.headless=true
      -Xshare:auto
      -Xms128M -Xmx512M
      -XX:+UseParallelOldGC

      "
      CLASSPATH=\
      $CATALINA_HOME/bin/commons-daemon.jar:\
      $CATALINA_HOME/bin/tomcat-juli.jar:\
      $CATALINA_HOME/bin/bootstrap.jar

      case "$1" in
      start)
      #
      # Start Tomcat
      #
      cd $CATALINA_HOME

      $DAEMON_HOME/jsvc \
      -user $TOMCAT_USER \
      -home $JAVA_HOME \
      -jvm server \
      -Dcatalina.home=$CATALINA_HOME \
      -Dcatalina.base=$CATALINA_BASE \
      -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
      -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties \
      -Djava.endorsed.dirs=$CATALINA_BASE/endorsed \
      -Djava.io.tmpdir=$TMP_DIR \
      $CATALINA_OPTS \
      $LOG_OPTS \
      $SECURITY_OPTS \
      $EXO_OPTS \
      -outfile $CATALINA_BASE/logs/catalina.out \
      -errfile '&1' \
      -classpath $CLASSPATH \
      org.apache.catalina.startup.Bootstrap start
      #
      # To get a verbose JVM
      #-verbose \
      # To get a debug of jsvc.
      #-debug \
      ;;

      stop)
      #
      # Stop Tomcat
      #
      PID=`cat $PIDFILE`
      if [ -f $PIDFILE ]
      then
      kill $PID
      else
      echo "No PID, TC not running?"
      fi
      ;;

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