changeset 26:c4a571313422 vendor

First import of config module
author robcast
date Thu, 17 Jan 2002 18:41:36 +0100
parents 7abc1ac0aece
children 7b5d0ff8f93f
files config/tomcat/bin/catalina.sh config/tomcat/bin/rctomcat config/tomcat/conf/server.xml
diffstat 3 files changed, 365 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/tomcat/bin/catalina.sh	Thu Jan 17 18:41:36 2002 +0100
@@ -0,0 +1,237 @@
+#!/bin/sh
+# -----------------------------------------------------------------------------
+# catalina.sh - Start/Stop Script for the CATALINA Server
+#
+# Environment Variable Prequisites
+#
+#   CATALINA_BASE (Optional) Base directory for resolving dynamic portions
+#                 of a Catalina installation.  If not present, resolves to
+#                 the same directory that CATALINA_HOME points to.
+#
+#   CATALINA_HOME (Optional) May point at your Catalina "build" directory.
+#                 If not present, the current working directory is assumed.
+#
+#   CATALINA_OPTS (Optional) Java runtime options used when the "start",
+#                 "stop", or "run" command is executed.
+#
+#   JAVA_HOME     Must point at your Java Development Kit installation.
+#
+#   JPDA_OPTS     (Optional) Java runtime options used when the "jpda start"
+#                 command is executed.  Defaults to
+#                 "-classic -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
+#
+#   JSSE_HOME     (Optional) May point at your Java Secure Sockets Extension
+#                 (JSSE) installation, whose JAR files will be added to the
+#                 system class path used to start Tomcat.
+#
+# $Id$
+# -----------------------------------------------------------------------------
+
+export JAVA_HOME=/usr/local/lib/IBMJava2-13
+export CATALINA_OPTS="-mx512m"
+
+
+# ----- Verify and Set Required Environment Variables -------------------------
+
+if [ -z "$CATALINA_HOME" ] ; then
+  ## resolve links - $0 may be a link to  home
+  PRG=$0
+  progname=`basename $0`
+  
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '.*/.*' > /dev/null; then
+	PRG="$link"
+    else
+	PRG="`dirname $PRG`/$link"
+    fi
+  done
+  
+  CATALINA_HOME_1=`dirname "$PRG"`/..
+  echo "Guessing CATALINA_HOME from catalina.sh to ${CATALINA_HOME_1}" 
+    if [ -d ${CATALINA_HOME_1}/conf ] ; then 
+	CATALINA_HOME=${CATALINA_HOME_1}
+	echo "Setting CATALINA_HOME to $CATALINA_HOME"
+    fi
+fi
+
+if [ -z "$CATALINA_OPTS" ] ; then
+  CATALINA_OPTS=""
+fi
+
+if [ -z "$JPDA_OPTS" ] ; then
+  JPDA_OPTS="-classic -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo You must set JAVA_HOME to point at your Java Development Kit installation
+  exit 1
+fi
+
+
+# ----- Cygwin Unix Paths Setup -----------------------------------------------
+
+# Cygwin support.  $cygwin _must_ be set to either true or false.
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  *) cygwin=false ;;
+esac
+ 
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$CATALINA_HOME" ] &&
+    CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
+    [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+
+# ----- Set Up The System Classpath -------------------------------------------
+
+CP="$CATALINA_HOME/bin/bootstrap.jar"
+
+if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
+  CP=$CP:"$JAVA_HOME/lib/tools.jar"
+fi
+if [ -f "$JSSE_HOME/lib/jsse.jar" ] ; then
+  CP=$CP:"$JSSE_HOME/lib/jcert.jar":"$JSSE_HOME/lib/jnet.jar":"$JSSE_HOME/lib/jsse.jar"
+fi
+
+
+# ----- Cygwin Windows Paths Setup --------------------------------------------
+
+# convert the existing path to windows
+if $cygwin ; then
+   CP=`cygpath --path --windows "$CP"`
+   CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
+   JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+fi
+
+
+# ----- Set Up CATALINA_BASE If Necessary -------------------------------------
+
+if [ -z "$CATALINA_BASE" ] ; then
+  CATALINA_BASE=$CATALINA_HOME
+fi
+
+
+# ----- Execute The Requested Command -----------------------------------------
+
+echo "Using CLASSPATH:     $CP"
+echo "Using CATALINA_BASE: $CATALINA_BASE"
+echo "Using CATALINA_HOME: $CATALINA_HOME"
+echo "Using JAVA_HOME:     $JAVA_HOME"
+
+if [ "$1" = "jpda" ] ; then
+  CATALINA_OPTS="${CATALINA_OPTS} ${JPDA_OPTS}"
+  shift
+fi
+
+if [ "$1" = "debug" ] ; then
+
+  shift
+  if [ "$1" = "-security" ] ; then
+    shift
+    $JAVA_HOME/bin/jdb \
+       $CATALINA_OPTS \
+       -sourcepath $CATALINA_HOME/../../jakarta-tomcat-4.0/catalina/src/share \
+       -classpath $CP \
+       -Dcatalina.base=$CATALINA_BASE \
+       -Dcatalina.home=$CATALINA_HOME \
+       org.apache.catalina.startup.Bootstrap "$@" start
+  else
+    $JAVA_HOME/bin/jdb \
+       $CATALINA_OPTS \
+       -sourcepath $CATALINA_HOME/../../jakarta-tomcat-4.0/catalina/src/share \
+       -classpath $CP \
+       -Dcatalina.base=$CATALINA_BASE \
+       -Dcatalina.home=$CATALINA_HOME \
+       org.apache.catalina.startup.Bootstrap "$@" start
+  fi
+
+elif [ "$1" = "embedded" ] ; then
+
+  shift
+  for i in ${CATALINA_HOME}/server/lib/*.jar ; do
+    CP=$i:${CP}
+  done
+  for i in ${CATALINA_HOME}/common/lib/*.jar ; do
+    CP=$i:${CP}
+  done
+  echo Embedded Classpath: $CP
+  $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
+   -Dcatalina.base=$CATALINA_BASE \
+   -Dcatalina.home=$CATALINA_HOME \
+   org.apache.catalina.startup.Embedded "$@"
+
+elif [ "$1" = "env" ] ; then
+
+  export BP CATALINA_HOME CP
+  exit 0
+
+elif [ "$1" = "run" ] ; then
+
+  shift
+  if [ "$1" = "-security" ] ; then
+    echo Using Security Manager
+    shift
+    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
+     -Djava.security.manager \
+     -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \
+     -Dcatalina.base=$CATALINA_BASE \
+     -Dcatalina.home=$CATALINA_HOME \
+     org.apache.catalina.startup.Bootstrap "$@" start
+  else
+    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
+     -Dcatalina.base=$CATALINA_BASE \
+     -Dcatalina.home=$CATALINA_HOME \
+     org.apache.catalina.startup.Bootstrap "$@" start
+  fi
+
+elif [ "$1" = "start" ] ; then
+
+  shift
+  touch $CATALINA_BASE/logs/catalina.out
+  if [ "$1" = "-security" ] ; then
+    echo Using Security Manager
+    shift
+    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
+     -Djava.security.manager \
+     -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \
+     -Dcatalina.base=$CATALINA_BASE \
+     -Dcatalina.home=$CATALINA_HOME \
+     org.apache.catalina.startup.Bootstrap "$@" start \
+     >> $CATALINA_BASE/logs/catalina.out 2>&1 &
+  else
+    $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
+     -Dcatalina.base=$CATALINA_BASE \
+     -Dcatalina.home=$CATALINA_HOME \
+     org.apache.catalina.startup.Bootstrap "$@" start \
+     >> $CATALINA_BASE/logs/catalina.out 2>&1 &
+  fi
+
+elif [ "$1" = "stop" ] ; then
+
+  shift
+  $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
+   -Dcatalina.base=$CATALINA_BASE \
+   -Dcatalina.home=$CATALINA_HOME \
+   org.apache.catalina.startup.Bootstrap "$@" stop
+
+else
+
+  echo "Usage: catalina.sh ( env | run | start | stop)"
+  echo "Commands:"
+  echo "  debug             Start Catalina in a debugger"
+  echo "  debug -security   Debug Catalina with a security manager"
+  echo "  env               Set up environment variables that would be used"
+  echo "  jpda start        Start Catalina under JPDA debugger"
+  echo "  run               Start Catalina in the current window"
+  echo "  run -security     Start in the current window with security manager"
+  echo "  start             Start Catalina in a separate window"
+  echo "  start -security   Start in a separate window with security manager"
+  echo "  stop              Stop Catalina"
+  exit 1
+
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/tomcat/bin/rctomcat	Thu Jan 17 18:41:36 2002 +0100
@@ -0,0 +1,86 @@
+#! /bin/sh
+#
+
+. /etc/rc.config
+
+# Determine the base and follow a runlevel link name.
+base=${0##*/}
+link=${base#*[SK][0-9][0-9]}
+
+# Force execution if not called by a runlevel directory.
+#test $link = $base && START_XNTPD=yes
+#test "$START_XNTPD" = yes || exit 0
+
+TOMCAT_PID="";
+
+function tomcat_runs() {
+# we're looking at java vms executing org.apache.catalina.startup.Bootstrap
+ALL_TOMS=$( ps xa|grep org.apache.catalina.startup.Bootstrap|grep -v grep )
+ALL_TOM_IDS=$( echo $ALL_TOMS | cut -d " " -f 1 )
+TOMCAT_PID=$( echo $ALL_TOM_IDS | head -1 )
+test -n "$TOMCAT_PID"
+}
+
+#
+# docuservers tomcat (ROC 2.11.01)
+#
+TOMCATLOG=/usr/local/httpd/logs/tomcat-err.log
+TOMCATDIR=/opt/tomcat
+
+return="$rc_done"
+
+case "$1" in
+    start)
+	echo -n "Starting Tomcat Servlet server "
+	su - wwwrun -c "$TOMCATDIR/bin/startup.sh" >> $TOMCATLOG 2>&1 || return=$rc_failed
+	echo -e "$return"
+	;;
+    stop)
+	echo -n "Stopping Tomcat Servlet server "
+	if su - wwwrun -c "$TOMCATDIR/bin/shutdown.sh" >> $TOMCATLOG 2>&1
+	then
+	    for i in 1 2 3 4 5
+	    do
+		if tomcat_runs
+		then
+		    return=$rc_failed
+		    echo -n "."
+		    sleep 2
+		else
+		    return=$rc_done
+		    break
+		fi
+	    done
+	    if tomcat_runs
+	    then
+		echo -n " killing."
+		kill $TOMCAT_PID
+		sleep 2
+	    fi
+	    if tomcat_runs
+	    then
+		return=$rc_failed
+	    else
+		return=$rc_done
+	    fi
+	else 
+	    return=$rc_failed
+	fi
+	
+	echo -e "$return"
+	;;
+    reload|restart)
+        $0 stop  &&  $0 start  ||  return=$rc_failed
+        ;;
+    status)
+	echo -n "Checking for service tomcat: "
+	tomcat_runs && echo OK || echo No process
+        ;;
+    *)
+	echo "Usage: $0 {start|stop|status|reload|restart}"
+	exit 1
+esac
+
+# Inform the caller not only verbosely and set an exit status.
+test "$return" = "$rc_done" || exit 1
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/tomcat/conf/server.xml	Thu Jan 17 18:41:36 2002 +0100
@@ -0,0 +1,42 @@
+<!-- Digilib Server Configuration File -->
+
+<Server port="8005" shutdown="SHUTDOWN" debug="0">
+
+  <!-- Define an Apache-Connector Service -->
+  <Service name="Tomcat-Docuserver">
+
+    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
+    <Connector className="org.apache.catalina.connector.http.HttpConnector"
+               port="8080" minProcessors="5" maxProcessors="75"
+               acceptCount="10" debug="0" connectionTimeout="60000"/>
+
+    <!-- Replace "localhost" with what your Apache "ServerName" is set to -->
+    <Engine className="org.apache.catalina.connector.warp.WarpEngine"
+     name="Apache" debug="1" appBase="webapps" defaultHost="hera.unibe.ch">
+
+      <!-- Global logger unless overridden at lower levels -->
+      <Logger className="org.apache.catalina.logger.FileLogger"
+              prefix="apache_log." suffix=".txt"
+              timestamp="true"/>
+
+      <!-- Define the default virtual host. Hostname must match the engine's. -->
+      <Host name="hera.unibe.ch" debug="0" appBase="/docuserver/tmp/digilib-test/docuserver">
+
+        <Context path="/docuserver/digitallibrary" docBase="/docuserver/tmp/digilib-test/docuserver/digitallibrary" debug="0" reloadable="false">
+	</Context>
+
+<!--
+        <Context path="/manager" docBase="/opt/tomcat/webapps/manager" debug="0" reloadable="false">
+	</Context>
+-->
+
+      </Host>
+
+      <!-- Because this Realm is here, an instance will be shared globally -->
+      <Realm className="org.apache.catalina.realm.MemoryRealm" />
+
+    </Engine>
+
+  </Service>
+
+</Server>