Anoop's major update. Everything has changed location.
This commit is contained in:
parent
c4c899c895
commit
6251b6c670
438 changed files with 40585 additions and 0 deletions
BIN
tomcat/bin/LauncherBootstrap.class
Normal file
BIN
tomcat/bin/LauncherBootstrap.class
Normal file
Binary file not shown.
BIN
tomcat/bin/bootstrap.jar
Normal file
BIN
tomcat/bin/bootstrap.jar
Normal file
Binary file not shown.
192
tomcat/bin/catalina.50.bat
Normal file
192
tomcat/bin/catalina.50.bat
Normal file
|
@ -0,0 +1,192 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem Start/Stop Script for the CATALINA Server
|
||||
rem
|
||||
rem Environment Variable Prequisites
|
||||
rem
|
||||
rem CATALINA_HOME May point at your Catalina "build" directory.
|
||||
rem
|
||||
rem CATALINA_BASE (Optional) Base directory for resolving dynamic portions
|
||||
rem of a Catalina installation. If not present, resolves to
|
||||
rem the same directory that CATALINA_HOME points to.
|
||||
rem
|
||||
rem CATALINA_OPTS (Optional) Java runtime options used when the "start",
|
||||
rem "stop", or "run" command is executed.
|
||||
rem
|
||||
rem CATALINA_TMPDIR (Optional) Directory path location of temporary directory
|
||||
rem the JVM should use (java.io.tmpdir). Defaults to
|
||||
rem %CATALINA_BASE%\temp.
|
||||
rem
|
||||
rem JAVA_HOME Must point at your Java Development Kit installation.
|
||||
rem
|
||||
rem JAVA_OPTS (Optional) Java runtime options used when the "start",
|
||||
rem "stop", or "run" command is executed.
|
||||
rem
|
||||
rem JSSE_HOME (Optional) May point at your Java Secure Sockets Extension
|
||||
rem (JSSE) installation, whose JAR files will be added to the
|
||||
rem system class path used to start Tomcat.
|
||||
rem
|
||||
rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
|
||||
rem command is executed. The default is "dt_shmem".
|
||||
rem
|
||||
rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
|
||||
rem command is executed. The default is "jdbconn".
|
||||
rem
|
||||
rem $Id: catalina.50.bat,v 1.1 2005/02/21 06:54:22 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
set CURRENT_DIR=%cd%
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=%CURRENT_DIR%
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
cd ..
|
||||
set CATALINA_HOME=%cd%
|
||||
cd %CURRENT_DIR%
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
echo The CATALINA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
|
||||
rem Get standard environment variables
|
||||
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
|
||||
|
||||
rem Get standard Java environment variables
|
||||
if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
|
||||
echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
|
||||
echo This file is needed to run this program
|
||||
goto end
|
||||
:okSetclasspath
|
||||
set BASEDIR=%CATALINA_HOME%
|
||||
call "%CATALINA_HOME%\bin\setclasspath.bat"
|
||||
|
||||
rem Add on extra jar files to CLASSPATH
|
||||
if "%JSSE_HOME%" == "" goto noJsse
|
||||
set CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar
|
||||
:noJsse
|
||||
set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
|
||||
|
||||
if not "%CATALINA_BASE%" == "" goto gotBase
|
||||
set CATALINA_BASE=%CATALINA_HOME%
|
||||
:gotBase
|
||||
|
||||
if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
|
||||
set CATALINA_TMPDIR=%CATALINA_BASE%\temp
|
||||
:gotTmpdir
|
||||
|
||||
rem ----- Execute The Requested Command ---------------------------------------
|
||||
|
||||
echo Using CATALINA_BASE: %CATALINA_BASE%
|
||||
echo Using CATALINA_HOME: %CATALINA_HOME%
|
||||
echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%
|
||||
echo Using JAVA_HOME: %JAVA_HOME%
|
||||
|
||||
set _EXECJAVA=%_RUNJAVA%
|
||||
set MAINCLASS=org.apache.catalina.startup.Bootstrap
|
||||
set ACTION=start
|
||||
set SECURITY_POLICY_FILE=
|
||||
set DEBUG_OPTS=
|
||||
set JPDA=
|
||||
|
||||
if not ""%1"" == ""jpda"" goto noJpda
|
||||
set JPDA=jpda
|
||||
if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
|
||||
set JPDA_TRANSPORT=dt_shmem
|
||||
:gotJpdaTransport
|
||||
if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
|
||||
set JPDA_ADDRESS=jdbconn
|
||||
:gotJpdaAddress
|
||||
shift
|
||||
:noJpda
|
||||
|
||||
if ""%1"" == ""debug"" goto doDebug
|
||||
if ""%1"" == ""run"" goto doRun
|
||||
if ""%1"" == ""start"" goto doStart
|
||||
if ""%1"" == ""stop"" goto doStop
|
||||
if ""%1"" == ""version"" goto doVersion
|
||||
|
||||
echo Usage: catalina ( commands ... )
|
||||
echo commands:
|
||||
echo debug Start Catalina in a debugger
|
||||
echo debug -security Debug Catalina with a security manager
|
||||
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
|
||||
echo version What version of tomcat are you running?
|
||||
goto end
|
||||
|
||||
:doDebug
|
||||
shift
|
||||
set _EXECJAVA=%_RUNJDB%
|
||||
set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\jakarta-tomcat-catalina\catalina\src\share"
|
||||
if not ""%1"" == ""-security"" goto execCmd
|
||||
shift
|
||||
echo Using Security Manager
|
||||
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
|
||||
goto execCmd
|
||||
|
||||
:doRun
|
||||
shift
|
||||
if not ""%1"" == ""-security"" goto execCmd
|
||||
shift
|
||||
echo Using Security Manager
|
||||
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
|
||||
goto execCmd
|
||||
|
||||
:doStart
|
||||
shift
|
||||
if not "%OS%" == "Windows_NT" goto noTitle
|
||||
set _EXECJAVA=start "Tomcat" %_RUNJAVA%
|
||||
goto gotTitle
|
||||
:noTitle
|
||||
set _EXECJAVA=start %_RUNJAVA%
|
||||
:gotTitle
|
||||
if not ""%1"" == ""-security"" goto execCmd
|
||||
shift
|
||||
echo Using Security Manager
|
||||
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
|
||||
goto execCmd
|
||||
|
||||
:doStop
|
||||
shift
|
||||
set ACTION=stop
|
||||
goto execCmd
|
||||
|
||||
:doVersion
|
||||
%_EXECJAVA% -classpath "%CATALINA_HOME%\server\lib\catalina.jar" org.apache.catalina.util.ServerInfo
|
||||
goto end
|
||||
|
||||
|
||||
:execCmd
|
||||
rem Get remaining unshifted command line arguments and save them in the
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
rem Execute Java with the applicable properties
|
||||
if not "%JPDA%" == "" goto doJpda
|
||||
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
:doSecurity
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
:doJpda
|
||||
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
:doSecurityJpda
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
|
||||
:end
|
287
tomcat/bin/catalina.50.sh
Normal file
287
tomcat/bin/catalina.50.sh
Normal file
|
@ -0,0 +1,287 @@
|
|||
#!/bin/sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Start/Stop Script for the CATALINA Server
|
||||
#
|
||||
# Environment Variable Prequisites
|
||||
#
|
||||
# CATALINA_HOME May point at your Catalina "build" directory.
|
||||
#
|
||||
# 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_OPTS (Optional) Java runtime options used when the "start",
|
||||
# "stop", or "run" command is executed.
|
||||
#
|
||||
# CATALINA_TMPDIR (Optional) Directory path location of temporary directory
|
||||
# the JVM should use (java.io.tmpdir). Defaults to
|
||||
# $CATALINA_BASE/temp.
|
||||
#
|
||||
# JAVA_HOME Must point at your Java Development Kit installation.
|
||||
#
|
||||
# JAVA_OPTS (Optional) Java runtime options used when the "start",
|
||||
# "stop", or "run" command is executed.
|
||||
#
|
||||
# JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
|
||||
# command is executed. The default is "dt_socket".
|
||||
#
|
||||
# JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
|
||||
# command is executed. The default is 8000.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# CATALINA_PID (Optional) Path of the file which should contains the pid
|
||||
# of catalina startup java process, when start (fork) is used
|
||||
#
|
||||
# $Id: catalina.50.sh,v 1.1 2005/02/21 06:54:22 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false
|
||||
os400=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true;;
|
||||
OS400*) os400=true;;
|
||||
esac
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
# Get standard environment variables
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
|
||||
# Only set CATALINA_HOME if not already set
|
||||
[ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
|
||||
|
||||
if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
|
||||
. "$CATALINA_HOME"/bin/setenv.sh
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
|
||||
[ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath --unix "$CATALINA_BASE"`
|
||||
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
[ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --absolute --unix "$JSSE_HOME"`
|
||||
fi
|
||||
|
||||
# For OS400
|
||||
if $os400; then
|
||||
# Set job priority to standard for interactive (interactive - 6) by using
|
||||
# the interactive priority - 6, the helper threads that respond to requests
|
||||
# will be running at the same priority as interactive jobs.
|
||||
COMMAND='chgjob job('$JOBNAME') runpty(6)'
|
||||
system $COMMAND
|
||||
|
||||
# Enable multi threading
|
||||
export QIBM_MULTI_THREADED=Y
|
||||
fi
|
||||
|
||||
# Get standard Java environment variables
|
||||
if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
|
||||
BASEDIR="$CATALINA_HOME"
|
||||
. "$CATALINA_HOME"/bin/setclasspath.sh
|
||||
else
|
||||
echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh"
|
||||
echo "This file is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add on extra jar files to CLASSPATH
|
||||
if [ -n "$JSSE_HOME" ]; then
|
||||
CLASSPATH="$CLASSPATH":"$JSSE_HOME"/lib/jcert.jar:"$JSSE_HOME"/lib/jnet.jar:"$JSSE_HOME"/lib/jsse.jar
|
||||
fi
|
||||
CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar
|
||||
|
||||
if [ -z "$CATALINA_BASE" ] ; then
|
||||
CATALINA_BASE="$CATALINA_HOME"
|
||||
fi
|
||||
|
||||
if [ -z "$CATALINA_TMPDIR" ] ; then
|
||||
# Define the java.io.tmpdir to use for Catalina
|
||||
CATALINA_TMPDIR="$CATALINA_BASE"/temp
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
|
||||
CATALINA_HOME=`cygpath --absolute --windows "$CATALINA_HOME"`
|
||||
CATALINA_BASE=`cygpath --absolute --windows "$CATALINA_BASE"`
|
||||
CATALINA_TMPDIR=`cygpath --absolute --windows "$CATALINA_TMPDIR"`
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --absolute --windows "$JSSE_HOME"`
|
||||
JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"`
|
||||
fi
|
||||
|
||||
# ----- Execute The Requested Command -----------------------------------------
|
||||
|
||||
echo "Using CATALINA_BASE: $CATALINA_BASE"
|
||||
echo "Using CATALINA_HOME: $CATALINA_HOME"
|
||||
echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
|
||||
echo "Using JAVA_HOME: $JAVA_HOME"
|
||||
|
||||
if [ "$1" = "jpda" ] ; then
|
||||
if [ -z "$JPDA_TRANSPORT" ]; then
|
||||
JPDA_TRANSPORT="dt_socket"
|
||||
fi
|
||||
if [ -z "$JPDA_ADDRESS" ]; then
|
||||
JPDA_ADDRESS="8000"
|
||||
fi
|
||||
if [ -z "$JPDA_OPTS" ]; then
|
||||
JPDA_OPTS="-Xdebug -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n"
|
||||
fi
|
||||
CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$1" = "debug" ] ; then
|
||||
|
||||
if $os400; then
|
||||
echo "Debug command not available on OS400"
|
||||
exit 1
|
||||
else
|
||||
shift
|
||||
if [ "$1" = "-security" ] ; then
|
||||
echo "Using Security Manager"
|
||||
shift
|
||||
exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-classpath "$CLASSPATH" \
|
||||
-sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-catalina/catalina/src/share \
|
||||
-Djava.security.manager \
|
||||
-Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start
|
||||
else
|
||||
exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-classpath "$CLASSPATH" \
|
||||
-sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-catalina/catalina/src/share \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$1" = "run" ]; then
|
||||
|
||||
shift
|
||||
if [ "$1" = "-security" ] ; then
|
||||
echo "Using Security Manager"
|
||||
shift
|
||||
exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-classpath "$CLASSPATH" \
|
||||
-Djava.security.manager \
|
||||
-Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start
|
||||
else
|
||||
exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-classpath "$CLASSPATH" \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
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
|
||||
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-classpath "$CLASSPATH" \
|
||||
-Djava.security.manager \
|
||||
-Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start \
|
||||
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
|
||||
|
||||
if [ ! -z "$CATALINA_PID" ]; then
|
||||
echo $! > $CATALINA_PID
|
||||
fi
|
||||
else
|
||||
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-classpath "$CLASSPATH" \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start \
|
||||
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
|
||||
|
||||
if [ ! -z "$CATALINA_PID" ]; then
|
||||
echo $! > $CATALINA_PID
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ] ; then
|
||||
|
||||
shift
|
||||
FORCE=0
|
||||
if [ "$1" = "-force" ]; then
|
||||
shift
|
||||
FORCE=1
|
||||
fi
|
||||
|
||||
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-classpath "$CLASSPATH" \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" stop
|
||||
|
||||
if [ $FORCE -eq 1 ]; then
|
||||
if [ ! -z "$CATALINA_PID" ]; then
|
||||
echo "Killing: `cat $CATALINA_PID`"
|
||||
kill -9 `cat $CATALINA_PID`
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$1" = "version" ] ; then
|
||||
|
||||
"$_RUNJAVA" \
|
||||
-classpath "$CATALINA_HOME/server/lib/catalina.jar" \
|
||||
org.apache.catalina.util.ServerInfo
|
||||
|
||||
else
|
||||
|
||||
echo "Usage: catalina.sh ( commands ... )"
|
||||
echo "commands:"
|
||||
if $os400; then
|
||||
echo " debug Start Catalina in a debugger (not available on OS400)"
|
||||
echo " debug -security Debug Catalina with a security manager (not available on OS400)"
|
||||
else
|
||||
echo " debug Start Catalina in a debugger"
|
||||
echo " debug -security Debug Catalina with a security manager"
|
||||
fi
|
||||
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"
|
||||
echo " stop -force Stop Catalina (followed by kill -KILL)"
|
||||
echo " version What version of tomcat are you running?"
|
||||
exit 1
|
||||
|
||||
fi
|
192
tomcat/bin/catalina.bat
Normal file
192
tomcat/bin/catalina.bat
Normal file
|
@ -0,0 +1,192 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem Start/Stop Script for the CATALINA Server
|
||||
rem
|
||||
rem Environment Variable Prequisites
|
||||
rem
|
||||
rem CATALINA_HOME May point at your Catalina "build" directory.
|
||||
rem
|
||||
rem CATALINA_BASE (Optional) Base directory for resolving dynamic portions
|
||||
rem of a Catalina installation. If not present, resolves to
|
||||
rem the same directory that CATALINA_HOME points to.
|
||||
rem
|
||||
rem CATALINA_OPTS (Optional) Java runtime options used when the "start",
|
||||
rem "stop", or "run" command is executed.
|
||||
rem
|
||||
rem CATALINA_TMPDIR (Optional) Directory path location of temporary directory
|
||||
rem the JVM should use (java.io.tmpdir). Defaults to
|
||||
rem %CATALINA_BASE%\temp.
|
||||
rem
|
||||
rem JAVA_HOME Must point at your Java Development Kit installation.
|
||||
rem
|
||||
rem JAVA_OPTS (Optional) Java runtime options used when the "start",
|
||||
rem "stop", or "run" command is executed.
|
||||
rem
|
||||
rem JSSE_HOME (Optional) May point at your Java Secure Sockets Extension
|
||||
rem (JSSE) installation, whose JAR files will be added to the
|
||||
rem system class path used to start Tomcat.
|
||||
rem
|
||||
rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
|
||||
rem command is executed. The default is "dt_shmem".
|
||||
rem
|
||||
rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
|
||||
rem command is executed. The default is "jdbconn".
|
||||
rem
|
||||
rem $Id: catalina.bat,v 1.1 2005/02/21 06:54:22 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
set CURRENT_DIR=%cd%
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=%CURRENT_DIR%
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
cd ..
|
||||
set CATALINA_HOME=%cd%
|
||||
cd %CURRENT_DIR%
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
echo The CATALINA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
|
||||
rem Get standard environment variables
|
||||
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
|
||||
|
||||
rem Get standard Java environment variables
|
||||
if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
|
||||
echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
|
||||
echo This file is needed to run this program
|
||||
goto end
|
||||
:okSetclasspath
|
||||
set BASEDIR=%CATALINA_HOME%
|
||||
call "%CATALINA_HOME%\bin\setclasspath.bat"
|
||||
|
||||
rem Add on extra jar files to CLASSPATH
|
||||
if "%JSSE_HOME%" == "" goto noJsse
|
||||
set CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar
|
||||
:noJsse
|
||||
set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
|
||||
|
||||
if not "%CATALINA_BASE%" == "" goto gotBase
|
||||
set CATALINA_BASE=%CATALINA_HOME%
|
||||
:gotBase
|
||||
|
||||
if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
|
||||
set CATALINA_TMPDIR=%CATALINA_BASE%\temp
|
||||
:gotTmpdir
|
||||
|
||||
rem ----- Execute The Requested Command ---------------------------------------
|
||||
|
||||
echo Using CATALINA_BASE: %CATALINA_BASE%
|
||||
echo Using CATALINA_HOME: %CATALINA_HOME%
|
||||
echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%
|
||||
echo Using JAVA_HOME: %JAVA_HOME%
|
||||
|
||||
set _EXECJAVA=%_RUNJAVA%
|
||||
set MAINCLASS=org.apache.catalina.startup.Bootstrap
|
||||
set ACTION=start
|
||||
set SECURITY_POLICY_FILE=
|
||||
set DEBUG_OPTS=
|
||||
set JPDA=
|
||||
|
||||
if not ""%1"" == ""jpda"" goto noJpda
|
||||
set JPDA=jpda
|
||||
if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
|
||||
set JPDA_TRANSPORT=dt_shmem
|
||||
:gotJpdaTransport
|
||||
if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
|
||||
set JPDA_ADDRESS=jdbconn
|
||||
:gotJpdaAddress
|
||||
shift
|
||||
:noJpda
|
||||
|
||||
if ""%1"" == ""debug"" goto doDebug
|
||||
if ""%1"" == ""run"" goto doRun
|
||||
if ""%1"" == ""start"" goto doStart
|
||||
if ""%1"" == ""stop"" goto doStop
|
||||
if ""%1"" == ""version"" goto doVersion
|
||||
|
||||
echo Usage: catalina ( commands ... )
|
||||
echo commands:
|
||||
echo debug Start Catalina in a debugger
|
||||
echo debug -security Debug Catalina with a security manager
|
||||
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
|
||||
echo version What version of tomcat are you running?
|
||||
goto end
|
||||
|
||||
:doDebug
|
||||
shift
|
||||
set _EXECJAVA=%_RUNJDB%
|
||||
set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\jakarta-tomcat-catalina\catalina\src\share"
|
||||
if not ""%1"" == ""-security"" goto execCmd
|
||||
shift
|
||||
echo Using Security Manager
|
||||
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
|
||||
goto execCmd
|
||||
|
||||
:doRun
|
||||
shift
|
||||
if not ""%1"" == ""-security"" goto execCmd
|
||||
shift
|
||||
echo Using Security Manager
|
||||
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
|
||||
goto execCmd
|
||||
|
||||
:doStart
|
||||
shift
|
||||
if not "%OS%" == "Windows_NT" goto noTitle
|
||||
set _EXECJAVA=start "Tomcat" %_RUNJAVA%
|
||||
goto gotTitle
|
||||
:noTitle
|
||||
set _EXECJAVA=start %_RUNJAVA%
|
||||
:gotTitle
|
||||
if not ""%1"" == ""-security"" goto execCmd
|
||||
shift
|
||||
echo Using Security Manager
|
||||
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
|
||||
goto execCmd
|
||||
|
||||
:doStop
|
||||
shift
|
||||
set ACTION=stop
|
||||
goto execCmd
|
||||
|
||||
:doVersion
|
||||
%_EXECJAVA% -classpath "%CATALINA_HOME%\server\lib\catalina.jar" org.apache.catalina.util.ServerInfo
|
||||
goto end
|
||||
|
||||
|
||||
:execCmd
|
||||
rem Get remaining unshifted command line arguments and save them in the
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
rem Execute Java with the applicable properties
|
||||
if not "%JPDA%" == "" goto doJpda
|
||||
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
:doSecurity
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
:doJpda
|
||||
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
:doSecurityJpda
|
||||
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
|
||||
goto end
|
||||
|
||||
:end
|
287
tomcat/bin/catalina.sh
Normal file
287
tomcat/bin/catalina.sh
Normal file
|
@ -0,0 +1,287 @@
|
|||
#!/bin/sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Start/Stop Script for the CATALINA Server
|
||||
#
|
||||
# Environment Variable Prequisites
|
||||
#
|
||||
# CATALINA_HOME May point at your Catalina "build" directory.
|
||||
#
|
||||
# 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_OPTS (Optional) Java runtime options used when the "start",
|
||||
# "stop", or "run" command is executed.
|
||||
#
|
||||
# CATALINA_TMPDIR (Optional) Directory path location of temporary directory
|
||||
# the JVM should use (java.io.tmpdir). Defaults to
|
||||
# $CATALINA_BASE/temp.
|
||||
#
|
||||
# JAVA_HOME Must point at your Java Development Kit installation.
|
||||
#
|
||||
# JAVA_OPTS (Optional) Java runtime options used when the "start",
|
||||
# "stop", or "run" command is executed.
|
||||
#
|
||||
# JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
|
||||
# command is executed. The default is "dt_socket".
|
||||
#
|
||||
# JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
|
||||
# command is executed. The default is 8000.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# CATALINA_PID (Optional) Path of the file which should contains the pid
|
||||
# of catalina startup java process, when start (fork) is used
|
||||
#
|
||||
# $Id: catalina.sh,v 1.1 2005/02/21 06:54:22 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false
|
||||
os400=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true;;
|
||||
OS400*) os400=true;;
|
||||
esac
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
# Get standard environment variables
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
|
||||
# Only set CATALINA_HOME if not already set
|
||||
[ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
|
||||
|
||||
if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
|
||||
. "$CATALINA_HOME"/bin/setenv.sh
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
|
||||
[ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath --unix "$CATALINA_BASE"`
|
||||
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
[ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --absolute --unix "$JSSE_HOME"`
|
||||
fi
|
||||
|
||||
# For OS400
|
||||
if $os400; then
|
||||
# Set job priority to standard for interactive (interactive - 6) by using
|
||||
# the interactive priority - 6, the helper threads that respond to requests
|
||||
# will be running at the same priority as interactive jobs.
|
||||
COMMAND='chgjob job('$JOBNAME') runpty(6)'
|
||||
system $COMMAND
|
||||
|
||||
# Enable multi threading
|
||||
export QIBM_MULTI_THREADED=Y
|
||||
fi
|
||||
|
||||
# Get standard Java environment variables
|
||||
if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
|
||||
BASEDIR="$CATALINA_HOME"
|
||||
. "$CATALINA_HOME"/bin/setclasspath.sh
|
||||
else
|
||||
echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh"
|
||||
echo "This file is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add on extra jar files to CLASSPATH
|
||||
if [ -n "$JSSE_HOME" ]; then
|
||||
CLASSPATH="$CLASSPATH":"$JSSE_HOME"/lib/jcert.jar:"$JSSE_HOME"/lib/jnet.jar:"$JSSE_HOME"/lib/jsse.jar
|
||||
fi
|
||||
CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar
|
||||
|
||||
if [ -z "$CATALINA_BASE" ] ; then
|
||||
CATALINA_BASE="$CATALINA_HOME"
|
||||
fi
|
||||
|
||||
if [ -z "$CATALINA_TMPDIR" ] ; then
|
||||
# Define the java.io.tmpdir to use for Catalina
|
||||
CATALINA_TMPDIR="$CATALINA_BASE"/temp
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
|
||||
CATALINA_HOME=`cygpath --absolute --windows "$CATALINA_HOME"`
|
||||
CATALINA_BASE=`cygpath --absolute --windows "$CATALINA_BASE"`
|
||||
CATALINA_TMPDIR=`cygpath --absolute --windows "$CATALINA_TMPDIR"`
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --absolute --windows "$JSSE_HOME"`
|
||||
JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"`
|
||||
fi
|
||||
|
||||
# ----- Execute The Requested Command -----------------------------------------
|
||||
|
||||
echo "Using CATALINA_BASE: $CATALINA_BASE"
|
||||
echo "Using CATALINA_HOME: $CATALINA_HOME"
|
||||
echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
|
||||
echo "Using JAVA_HOME: $JAVA_HOME"
|
||||
|
||||
if [ "$1" = "jpda" ] ; then
|
||||
if [ -z "$JPDA_TRANSPORT" ]; then
|
||||
JPDA_TRANSPORT="dt_socket"
|
||||
fi
|
||||
if [ -z "$JPDA_ADDRESS" ]; then
|
||||
JPDA_ADDRESS="8000"
|
||||
fi
|
||||
if [ -z "$JPDA_OPTS" ]; then
|
||||
JPDA_OPTS="-Xdebug -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n"
|
||||
fi
|
||||
CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$1" = "debug" ] ; then
|
||||
|
||||
if $os400; then
|
||||
echo "Debug command not available on OS400"
|
||||
exit 1
|
||||
else
|
||||
shift
|
||||
if [ "$1" = "-security" ] ; then
|
||||
echo "Using Security Manager"
|
||||
shift
|
||||
exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-catalina/catalina/src/share \
|
||||
-Djava.security.manager \
|
||||
-Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start
|
||||
else
|
||||
exec "$_RUNJDB" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-sourcepath "$CATALINA_HOME"/../../jakarta-tomcat-catalina/catalina/src/share \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$1" = "run" ]; then
|
||||
|
||||
shift
|
||||
if [ "$1" = "-security" ] ; then
|
||||
echo "Using Security Manager"
|
||||
shift
|
||||
exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-Djava.security.manager \
|
||||
-Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start
|
||||
else
|
||||
exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
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
|
||||
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-Djava.security.manager \
|
||||
-Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start \
|
||||
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
|
||||
|
||||
if [ ! -z "$CATALINA_PID" ]; then
|
||||
echo $! > $CATALINA_PID
|
||||
fi
|
||||
else
|
||||
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" start \
|
||||
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
|
||||
|
||||
if [ ! -z "$CATALINA_PID" ]; then
|
||||
echo $! > $CATALINA_PID
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ] ; then
|
||||
|
||||
shift
|
||||
FORCE=0
|
||||
if [ "$1" = "-force" ]; then
|
||||
shift
|
||||
FORCE=1
|
||||
fi
|
||||
|
||||
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-Dcatalina.base="$CATALINA_BASE" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
|
||||
org.apache.catalina.startup.Bootstrap "$@" stop
|
||||
|
||||
if [ $FORCE -eq 1 ]; then
|
||||
if [ ! -z "$CATALINA_PID" ]; then
|
||||
echo "Killing: `cat $CATALINA_PID`"
|
||||
kill -9 `cat $CATALINA_PID`
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$1" = "version" ] ; then
|
||||
|
||||
"$_RUNJAVA" \
|
||||
-classpath "$CATALINA_HOME/server/lib/catalina.jar" \
|
||||
org.apache.catalina.util.ServerInfo
|
||||
|
||||
else
|
||||
|
||||
echo "Usage: catalina.sh ( commands ... )"
|
||||
echo "commands:"
|
||||
if $os400; then
|
||||
echo " debug Start Catalina in a debugger (not available on OS400)"
|
||||
echo " debug -security Debug Catalina with a security manager (not available on OS400)"
|
||||
else
|
||||
echo " debug Start Catalina in a debugger"
|
||||
echo " debug -security Debug Catalina with a security manager"
|
||||
fi
|
||||
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"
|
||||
echo " stop -force Stop Catalina (followed by kill -KILL)"
|
||||
echo " version What version of tomcat are you running?"
|
||||
exit 1
|
||||
|
||||
fi
|
234
tomcat/bin/catalina.xml
Normal file
234
tomcat/bin/catalina.xml
Normal file
|
@ -0,0 +1,234 @@
|
|||
<!--
|
||||
XML file for launching Catalina applications using ant.
|
||||
-->
|
||||
|
||||
<project name="Catalina Launcher" default="catalina" basedir=".">
|
||||
<property file="${user.home}/.tomcat5.properties"/>
|
||||
|
||||
<!-- Set the application home to the parent directory of this directory -->
|
||||
<property name="catalina.home" location="${basedir}/.."/>
|
||||
<property name="bootstrap.jar" location="${catalina.home}/bin/bootstrap.jar"/>
|
||||
|
||||
<!-- Import the user's custom properties -->
|
||||
<property file="${catalina.home}/bin/catalina.properties"/> <!-- XXX shold it be conf ?? -->
|
||||
<property file="${catalina.home}/conf/catalina.properties"/> <!-- XXX shold it be conf ?? -->
|
||||
|
||||
|
||||
<!-- Set user configurable properties -->
|
||||
<property name="jsse.home" location="${catalina.home}"/>
|
||||
<property name="catalina.base" location="${catalina.home}"/>
|
||||
<property name="catalina.tmpdir" location="${catalina.base}/temp"/>
|
||||
<property name="catalina.out" location="${catalina.base}/logs/catalina.out"/>
|
||||
<property name="catalina.policy" location="${catalina.base}/conf/catalina.policy"/>
|
||||
<property name="catalina.jvm.args" value="-Dsun.io.useCanonCaches=false"/>
|
||||
|
||||
<property name="catalina.source.path" value="${catalina.home}/../../jakarta-servletapi-5/src/share:${catalina.home}/../../jakarta-tomcat-jasper/jasper2/src/share:${catalina.home}/../../jakarta-tomcat-connectors/coyote/src/java:${catalina.home}/../../jakarta-tomcat-catalina/catalina/src/share"/>
|
||||
|
||||
|
||||
<!-- Build the classpath relative to the application home -->
|
||||
<path id="base.class.path">
|
||||
<pathelement location="${bootstrap.jar}"/>
|
||||
<pathelement path="${jsse.home}/lib/jsse.jar:${jsse.home}/lib/jcert.jar:${jsse.home}/lib/jnet.jar"/>
|
||||
</path>
|
||||
|
||||
<property name="basedir" location="."/>
|
||||
|
||||
<property name="tools.jar" location="${java.home}/../lib/tools.jar" />
|
||||
|
||||
<path id="tomcatcp" >
|
||||
<pathelement location="${catalina.home}/bin/bootstrap.jar"/>
|
||||
<!--
|
||||
<fileset dir="${catalina.home}/common/lib" includes="*.jar"/>
|
||||
<fileset dir="${catalina.home}/server/lib" includes="*.jar"/>
|
||||
<pathelement location="${catalina.home}/common/classes"/>
|
||||
-->
|
||||
<!--
|
||||
<pathelement location="${ant.home}/lib/xercesImpl.jar" />
|
||||
<pathelement location="${ant.home}/lib/xml-apis.jar" />
|
||||
-->
|
||||
<pathelement location="${ant.home}/lib/ant.jar" />
|
||||
<pathelement location="${tools.jar}" />
|
||||
</path>
|
||||
|
||||
|
||||
<!-- =================== Initialization/helpers ================== -->
|
||||
|
||||
|
||||
<target name="init"
|
||||
description="Display configuration and conditional compilation flags">
|
||||
</target>
|
||||
|
||||
<target name="init-launcher" >
|
||||
<!-- Build the sysproperties relative to the application home -->
|
||||
<syspropertyset id="base.sys.properties">
|
||||
<sysproperty key="java.endorsed.dirs" file="${catalina.home}/common/endorsed"/>
|
||||
<sysproperty key="java.io.tmpdir" file="${catalina.tmpdir}"/>
|
||||
<sysproperty key="catalina.home" file="${catalina.home}"/>
|
||||
<sysproperty key="catalina.base" file="${catalina.base}"/>
|
||||
</syspropertyset>
|
||||
|
||||
<!-- Build the standard jvmargs -->
|
||||
<jvmargset id="base.jvm.args">
|
||||
<jvmarg line="${catalina.jvm.args}"/>
|
||||
<jvmarg value="-Xdebug" if="jpda.settings"/>
|
||||
<jvmarg value="-Xrunjdwp:${jpda.settings}" if="jpda.settings"/>
|
||||
<jvmarg value="-sourcepath" if="jdb"/>
|
||||
<jvmarg path="${catalina.source.path}" if="jdb"/>
|
||||
</jvmargset>
|
||||
</target>
|
||||
|
||||
<target name="echo-config" >
|
||||
<echo>TOMCAT_HOME=${catalina.home}</echo>
|
||||
<echo>CLASSPATH=${toString:tomcatcp}</echo>
|
||||
</target>
|
||||
|
||||
<target name="help" >
|
||||
<echo>
|
||||
To run any of the applications in the JDB debugger, execute the Launcher with
|
||||
a "-Ddebug=true" argument.
|
||||
|
||||
To run any of the applications in JPDA mode, execute the Launcher with a
|
||||
"-Djpda=true" argument.
|
||||
</echo>
|
||||
</target>
|
||||
|
||||
<!-- Target that sets JDB properties when the "debug" property is set -->
|
||||
<target name="setjdb" description="Set JDB properties" if="debug">
|
||||
<property name="jdb" value="true"/>
|
||||
</target>
|
||||
|
||||
<!-- Target that sets JPDA properties when the "jpda" property is set -->
|
||||
<target name="setjpda" description="Set JPDA properties" if="jpda">
|
||||
<condition property="jpda.transport" value="dt_shmem">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
<condition property="jpda.transport" value="dt_socket">
|
||||
<not>
|
||||
<os family="windows"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="jpda.address" value="jdbconn">
|
||||
<equals arg1="${jpda.transport}" arg2="dt_shmem"/>
|
||||
</condition>
|
||||
<condition property="jpda.address" value="8000">
|
||||
<not>
|
||||
<equals arg1="${jpda.transport}" arg2="dt_shmem"/>
|
||||
</not>
|
||||
</condition>
|
||||
<property name="jpda.suspend" value="y"/>
|
||||
<property name="jpda.settings" value="transport=${jpda.transport},address=${jpda.address},server=y,suspend=${jpda.suspend}"/>
|
||||
</target>
|
||||
|
||||
<!-- =================== Launcher-based ================== -->
|
||||
|
||||
<!-- Target that executes Catalina -->
|
||||
<target name="catalina" description="Execute Catalina"
|
||||
depends="init-launcher,setjdb,setjpda" >
|
||||
|
||||
<!-- Set default title for minimized window -->
|
||||
<property name="catalina.window.title" value="Catalina"/>
|
||||
|
||||
<!--
|
||||
Launch Catalina. Note that the "filterclassname" attribute will force
|
||||
the "waitforchild" attribute to "true" if any invalid arguments are
|
||||
used or if "start" is not the last argument.
|
||||
-->
|
||||
<launch classname="org.apache.catalina.startup.Bootstrap"
|
||||
waitforchild="${wait}"
|
||||
debug="${jdb}"
|
||||
print="${print}"
|
||||
filterclassname="org.apache.catalina.launcher.CatalinaLaunchFilter"
|
||||
filterclasspath="${bootstrap.jar}"
|
||||
usesystemin="false"
|
||||
requiretools="true"
|
||||
redirectoutput="true"
|
||||
output="${catalina.out}"
|
||||
displayMinimizedWindow="true"
|
||||
minimizedWindowTitle="${catalina.window.title}">
|
||||
<jvmargset refid="base.jvm.args"/>
|
||||
<syspropertyset refid="base.sys.properties"/>
|
||||
<sysproperty key="java.security.manager" value="" if="security"/>
|
||||
<sysproperty key="java.security.policy" value="=${catalina.policy}" if="security"/>
|
||||
<classpath refid="base.class.path"/>
|
||||
</launch>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- Target that executes the Catalina tool wrapper -->
|
||||
<target name="tool-wrapper" description="Execute Catalina tool wrapper"
|
||||
depends="setjdb,setjpda" >
|
||||
|
||||
<!-- Launch Catalina tool wrapper -->
|
||||
<launch classname="org.apache.catalina.startup.Tool"
|
||||
debug="${jdb}"
|
||||
print="${print}"
|
||||
usesystemin="false"
|
||||
requiretools="true">
|
||||
<jvmargset refid="base.jvm.args"/>
|
||||
<syspropertyset refid="base.sys.properties"/>
|
||||
<classpath refid="base.class.path"/>
|
||||
</launch>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- ======================= Ant/JMX based ================ -->
|
||||
|
||||
<target name="taskdef" >
|
||||
<property name="tomcat.home" location=".." />
|
||||
|
||||
<path id="jmx.test.classpath">
|
||||
<pathelement location="${commons-modeler.jar}" />
|
||||
<fileset dir="${tomcat.home}/common/lib" includes="*.jar"/>
|
||||
<fileset dir="${tomcat.home}/server/lib" includes="*.jar"/>
|
||||
<fileset dir="${tomcat.home}/bin" includes="*.jar"/>
|
||||
</path>
|
||||
|
||||
<!-- part of modeler -->
|
||||
<taskdef resource="META-INF/ant.properties"
|
||||
classpathref="jmx.test.classpath" />
|
||||
</target>
|
||||
|
||||
|
||||
<target name="run" depends="echo-config,taskdef"
|
||||
description="Start tomcat as a task and return">
|
||||
|
||||
<MLET code="org.apache.commons.modeler.BaseModelMBean"
|
||||
name="catalina:type=server" >
|
||||
<arg value="org.apache.catalina.startup.Catalina" />
|
||||
</MLET>
|
||||
|
||||
<jmxSet name="catalina:type=server"
|
||||
attribute="catalinaHome"
|
||||
value="${tomcat.home}"/>
|
||||
|
||||
<!-- We could also call init and set other properties -
|
||||
init should load the modules -->
|
||||
|
||||
<jmx name="catalina:type=server"
|
||||
method="start" />
|
||||
|
||||
<echo message="Tomcat5 running"/>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
<!-- ======================= Exec/java ================ -->
|
||||
|
||||
<target name="java-start" depends="echo-config"
|
||||
description="Run tomcat in-process and wait for it to end, using java task" >
|
||||
|
||||
<property name="tomcat.fork" value="false" />
|
||||
|
||||
<java classname="org.apache.catalina.startup.Bootstrap" fork="${tomcat.fork}">
|
||||
<classpath refid="tomcatcp" />
|
||||
<arg value="startd" />
|
||||
<sysproperty key="catalina.home" value="${catalina.home}"/>
|
||||
<sysproperty key="build.compiler" value="jikes"/>
|
||||
<sysproperty key="java.endorsed.dirs" value="${ant.home}/lib:${java.home}/lib"/>
|
||||
</java>
|
||||
|
||||
<echo message="Tomcat5 running"/>
|
||||
|
||||
</target>
|
||||
|
||||
</project>
|
BIN
tomcat/bin/commons-daemon.jar
Normal file
BIN
tomcat/bin/commons-daemon.jar
Normal file
Binary file not shown.
BIN
tomcat/bin/commons-launcher.jar
Normal file
BIN
tomcat/bin/commons-launcher.jar
Normal file
Binary file not shown.
BIN
tomcat/bin/commons-logging-api.jar
Normal file
BIN
tomcat/bin/commons-logging-api.jar
Normal file
Binary file not shown.
19
tomcat/bin/cpappend.bat
Normal file
19
tomcat/bin/cpappend.bat
Normal file
|
@ -0,0 +1,19 @@
|
|||
rem ---------------------------------------------------------------------------
|
||||
rem Append to CLASSPATH
|
||||
rem
|
||||
rem $Id: cpappend.bat,v 1.1 2005/02/21 06:54:22 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Process the first argument
|
||||
if ""%1"" == """" goto end
|
||||
set CLASSPATH=%CLASSPATH%;%1
|
||||
shift
|
||||
|
||||
rem Process the remaining arguments
|
||||
:setArgs
|
||||
if ""%1"" == """" goto doneSetArgs
|
||||
set CLASSPATH=%CLASSPATH% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
:end
|
41
tomcat/bin/digest.bat
Normal file
41
tomcat/bin/digest.bat
Normal file
|
@ -0,0 +1,41 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem Script to digest password using the algorithm specified
|
||||
rem
|
||||
rem $Id: digest.bat,v 1.1 2005/02/21 06:54:22 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=.
|
||||
if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
|
||||
set CATALINA_HOME=..
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
|
||||
echo The CATALINA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
|
||||
set EXECUTABLE=%CATALINA_HOME%\bin\tool-wrapper.bat
|
||||
|
||||
rem Check that target executable exists
|
||||
if exist "%EXECUTABLE%" goto okExec
|
||||
echo Cannot find %EXECUTABLE%
|
||||
echo This file is needed to run this program
|
||||
goto end
|
||||
:okExec
|
||||
|
||||
rem Get remaining unshifted command line arguments and save them in the
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
call "%EXECUTABLE%" -server org.apache.catalina.realm.RealmBase %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
31
tomcat/bin/digest.sh
Normal file
31
tomcat/bin/digest.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Script to digest password using the algorithm specified
|
||||
#
|
||||
# $Id: digest.sh,v 1.1 2005/02/21 06:54:22 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
EXECUTABLE=tool-wrapper.sh
|
||||
|
||||
# Check that target executable exists
|
||||
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
|
||||
echo "Cannot find $PRGDIR/$EXECUTABLE"
|
||||
echo "This file is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$PRGDIR"/"$EXECUTABLE" -server org.apache.catalina.realm.RealmBase "$@"
|
BIN
tomcat/bin/jmx.jar
Normal file
BIN
tomcat/bin/jmx.jar
Normal file
Binary file not shown.
BIN
tomcat/bin/jsvc.tar.gz
Normal file
BIN
tomcat/bin/jsvc.tar.gz
Normal file
Binary file not shown.
23
tomcat/bin/launcher.properties
Normal file
23
tomcat/bin/launcher.properties
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# Properties for the LauncherBootstrap class
|
||||
#
|
||||
# This file contains the following configurable properties:
|
||||
# - ant.class.path - This property is a ":" separated list of the URL file
|
||||
# fragments where the Ant classes are located. The list must include a JAXP
|
||||
# compliant XML parser if you are not using Java(TM) SE 1.4 or higher.
|
||||
#
|
||||
# Important notes:
|
||||
# - Relative URL file fragments, such as "../lib", are supported and strongly
|
||||
# encouraged as absolute files prevent cross platform distribution.
|
||||
# - URL file fragments are the portions of a URL after the "file:" string.
|
||||
# This means that you must use "/" characters as directory separators on
|
||||
# all platforms. Also, ":" characters in a file fragment, such as in drive
|
||||
# portion of absolute Windows files, must be URL encoded as "%3A". Lastly,
|
||||
# directories must have a "/" character at the end.
|
||||
# - All relative URL file fragments in the above properties will be resolved
|
||||
# using the URL of the directory that the LauncherBootstrap class was
|
||||
# loaded from, not the current working directory. This ensures that the
|
||||
# LauncherBootstrap class can properly resolve the files without regard to
|
||||
# the current working directory.
|
||||
#
|
||||
ant.class.path=../common/lib/ant.jar:../common/lib/ant-launcher.jar:../common/endorsed/xercesImpl.jar:../common/endorsed/xml-apis.jar
|
99
tomcat/bin/service.bat
Normal file
99
tomcat/bin/service.bat
Normal file
|
@ -0,0 +1,99 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem NT Service Install/Uninstall script
|
||||
rem
|
||||
rem Options
|
||||
rem install Install the service using Tomcat5 as service name.
|
||||
rem Service is installed using default settings.
|
||||
rem remove Remove the service from the System.
|
||||
rem
|
||||
rem name (optional) If the second argument is present it is considered
|
||||
rem to be new service name
|
||||
rem
|
||||
rem $Id: service.bat,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
set CURRENT_DIR=%cd%
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=%cd%
|
||||
if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome
|
||||
rem CD to the upper dir
|
||||
cd ..
|
||||
set CATALINA_HOME=%cd%
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome
|
||||
echo The tomcat.exe was not found...
|
||||
echo The CATALINA_HOME environment variable is not defined correctly.
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
rem Make sure prerequisite environment variables are set
|
||||
if not "%JAVA_HOME%" == "" goto okHome
|
||||
echo The JAVA_HOME environment variable is not defined
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
if not "%CATALINA_BASE%" == "" goto gotBase
|
||||
set CATALINA_BASE=%CATALINA_HOME%
|
||||
:gotBase
|
||||
|
||||
set EXECUTABLE=%CATALINA_HOME%\bin\tomcat5.exe
|
||||
|
||||
rem Set default Service name
|
||||
set SERVICE_NAME=Tomcat5
|
||||
set PR_DISPLAYNAME=Apache Tomcat
|
||||
|
||||
if "%1" == "" goto displayUsage
|
||||
if "%2" == "" goto setServiceName
|
||||
set SERVICE_NAME=%2
|
||||
set PR_DISPLAYNAME=Apache Tomcat %2
|
||||
:setServiceName
|
||||
if %1 == install goto doInstall
|
||||
if %1 == remove goto doRemove
|
||||
echo Unknown parameter "%1"
|
||||
:displayUsage
|
||||
echo
|
||||
echo Usage: service.bat install/remove [service_name]
|
||||
goto end
|
||||
|
||||
:doRemove
|
||||
rem Remove the service
|
||||
"%EXECUTABLE%" //DS//%SERVICE_NAME%
|
||||
echo The service '%SERVICE_NAME%' has been removed
|
||||
goto end
|
||||
|
||||
:doInstall
|
||||
rem Install the service
|
||||
echo Installing the service '%SERVICE_NAME%' ...
|
||||
echo Using CATALINA_HOME: %CATALINA_HOME%
|
||||
echo Using JAVA_HOME: %JAVA_HOME%
|
||||
|
||||
rem Use the environment variables as an exaple
|
||||
rem Each command line option is prefixed with PR_
|
||||
|
||||
set PR_DESCRIPTION=Apache Tomcat Server - http://jakarta.apache.org/tomcat
|
||||
set PR_INSTALL=%EXECUTABLE%
|
||||
set PR_LOGPATH=%CATALINA_HOME%\logs
|
||||
set PR_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar
|
||||
rem Set the server jvm frrom JAVA_HOME
|
||||
set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll
|
||||
rem You can use the 'set PR_JVM=auto' for default JVM
|
||||
"%EXECUTABLE%" //IS//%SERVICE_NAME% --StartClass org.apache.catalina.startup.Bootstrap --StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop
|
||||
rem Clear the environment variables. They are not needed any more.
|
||||
set PR_DISPLAYNAME=
|
||||
set PR_DESCRIPTION=
|
||||
set PR_INSTALL=
|
||||
set PR_LOGPATH=
|
||||
set PR_CLASSPATH=
|
||||
set PR_JVM=
|
||||
rem Set extra parameters
|
||||
"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed" --StartMode jvm --StopMode jvm
|
||||
rem More extra parameters
|
||||
set PR_STDOUTPUT=%CATALINA_HOME%\logs\stdout.log
|
||||
set PR_STDERROR=%CATALINA_HOME%\logs\stderr.log
|
||||
"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMs 128 --JvmMx 256
|
||||
echo The service '%SERVICE_NAME%' has been installed.
|
||||
|
||||
:end
|
||||
cd %CURRENT_DIR%
|
57
tomcat/bin/setclasspath.bat
Normal file
57
tomcat/bin/setclasspath.bat
Normal file
|
@ -0,0 +1,57 @@
|
|||
rem ---------------------------------------------------------------------------
|
||||
rem Set CLASSPATH and Java options
|
||||
rem
|
||||
rem $Id: setclasspath.bat,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Make sure prerequisite environment variables are set
|
||||
if not "%JAVA_HOME%" == "" goto gotJavaHome
|
||||
echo The JAVA_HOME environment variable is not defined
|
||||
echo This environment variable is needed to run this program
|
||||
goto exit
|
||||
:gotJavaHome
|
||||
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
|
||||
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
|
||||
if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
|
||||
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
|
||||
goto okJavaHome
|
||||
:noJavaHome
|
||||
echo The JAVA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
echo NB: JAVA_HOME should point to a JDK not a JRE
|
||||
goto exit
|
||||
:okJavaHome
|
||||
|
||||
if not "%BASEDIR%" == "" goto gotBasedir
|
||||
echo The BASEDIR environment variable is not defined
|
||||
echo This environment variable is needed to run this program
|
||||
goto exit
|
||||
:gotBasedir
|
||||
if exist "%BASEDIR%\bin\setclasspath.bat" goto okBasedir
|
||||
echo The BASEDIR environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto exit
|
||||
:okBasedir
|
||||
|
||||
rem Set the default -Djava.endorsed.dirs argument
|
||||
set JAVA_ENDORSED_DIRS=%BASEDIR%\common\endorsed
|
||||
|
||||
rem Set standard CLASSPATH
|
||||
rem Note that there are no quotes as we do not want to introduce random
|
||||
rem quotes into the CLASSPATH
|
||||
set CLASSPATH=%JAVA_HOME%\lib\tools.jar
|
||||
|
||||
rem Set standard command for invoking Java.
|
||||
rem Note that NT requires a window name argument when using start.
|
||||
rem Also note the quoting as JAVA_HOME may contain spaces.
|
||||
set _RUNJAVA="%JAVA_HOME%\bin\java"
|
||||
set _RUNJAVAW="%JAVA_HOME%\bin\javaw"
|
||||
set _RUNJDB="%JAVA_HOME%\bin\jdb"
|
||||
set _RUNJAVAC="%JAVA_HOME%\bin\javac"
|
||||
|
||||
goto end
|
||||
|
||||
:exit
|
||||
exit /b 1
|
||||
|
||||
:end
|
61
tomcat/bin/setclasspath.sh
Normal file
61
tomcat/bin/setclasspath.sh
Normal file
|
@ -0,0 +1,61 @@
|
|||
# -----------------------------------------------------------------------------
|
||||
# Set CLASSPATH and Java options
|
||||
#
|
||||
# $Id: setclasspath.sh,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Make sure prerequisite environment variables are set
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
echo "The JAVA_HOME environment variable is not defined"
|
||||
echo "This environment variable is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
if $os400; then
|
||||
if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
|
||||
echo "The JAVA_HOME environment variable is not defined correctly"
|
||||
echo "This environment variable is needed to run this program"
|
||||
echo "NB: JAVA_HOME should point to a JDK not a JRE"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
|
||||
echo "The JAVA_HOME environment variable is not defined correctly"
|
||||
echo "This environment variable is needed to run this program"
|
||||
echo "NB: JAVA_HOME should point to a JDK not a JRE"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -z "$BASEDIR" ]; then
|
||||
echo "The BASEDIR environment variable is not defined"
|
||||
echo "This environment variable is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "$BASEDIR"/bin/setclasspath.sh ]; then
|
||||
echo "The BASEDIR environment variable is not defined correctly"
|
||||
echo "This environment variable is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the default -Djava.endorsed.dirs argument
|
||||
JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed
|
||||
|
||||
# Set standard CLASSPATH
|
||||
CLASSPATH="$JAVA_HOME"/lib/tools.jar
|
||||
|
||||
# OSX hack to CLASSPATH
|
||||
JIKESPATH=
|
||||
if [ `uname -s` = "Darwin" ]; then
|
||||
OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
|
||||
if [ -d "$OSXHACK" ]; then
|
||||
for i in "$OSXHACK"/*.jar; do
|
||||
JIKESPATH="$JIKESPATH":"$i"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set standard commands for invoking Java.
|
||||
_RUNJAVA="$JAVA_HOME"/bin/java
|
||||
if [ $os400 = false ]; then
|
||||
_RUNJDB="$JAVA_HOME"/bin/jdb
|
||||
fi
|
||||
_RUNJAVAC="$JAVA_HOME"/bin/javac
|
40
tomcat/bin/shutdown-using-launcher.bat
Normal file
40
tomcat/bin/shutdown-using-launcher.bat
Normal file
|
@ -0,0 +1,40 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem
|
||||
rem Script for shutting down Catalina using the Launcher
|
||||
rem
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Get standard environment variables
|
||||
set PRG=%0
|
||||
if exist %PRG%\..\setenv.bat goto gotCmdPath
|
||||
rem %0 must have been found by DOS using the %PATH% so we assume that
|
||||
rem setenv.bat will also be found in the %PATH%
|
||||
call setenv.bat
|
||||
goto doneSetenv
|
||||
:gotCmdPath
|
||||
call %PRG%\..\setenv.bat
|
||||
:doneSetenv
|
||||
|
||||
rem Make sure prerequisite environment variables are set
|
||||
if not "%JAVA_HOME%" == "" goto gotJavaHome
|
||||
echo The JAVA_HOME environment variable is not defined
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:gotJavaHome
|
||||
|
||||
rem Get command line arguments and save them with the proper quoting
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
rem Execute the Launcher using the "catalina" target
|
||||
"%JAVA_HOME%\bin\java.exe" -classpath %PRG%\..;"%PATH%";. LauncherBootstrap -launchfile catalina.xml -verbose catalina %CMD_LINE_ARGS% stop
|
||||
|
||||
:end
|
29
tomcat/bin/shutdown-using-launcher.sh
Normal file
29
tomcat/bin/shutdown-using-launcher.sh
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# Script for shutting down Catalina using the Launcher
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
# Get standard environment variables
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
if [ -r "$PRGDIR"/setenv.sh ]; then
|
||||
. "$PRGDIR"/setenv.sh
|
||||
fi
|
||||
|
||||
# Execute the Launcher using the "catalina" target
|
||||
exec "$JAVA_HOME"/bin/java -classpath "$PRGDIR" LauncherBootstrap -launchfile catalina.xml -verbose catalina "$@" stop
|
44
tomcat/bin/shutdown.bat
Normal file
44
tomcat/bin/shutdown.bat
Normal file
|
@ -0,0 +1,44 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem Stop script for the CATALINA Server
|
||||
rem
|
||||
rem $Id: shutdown.bat,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
set CURRENT_DIR=%cd%
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=%CURRENT_DIR%
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
cd ..
|
||||
set CATALINA_HOME=%cd%
|
||||
cd %CURRENT_DIR%
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
echo The CATALINA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
|
||||
set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat
|
||||
|
||||
rem Check that target executable exists
|
||||
if exist "%EXECUTABLE%" goto okExec
|
||||
echo Cannot find %EXECUTABLE%
|
||||
echo This file is needed to run this program
|
||||
goto end
|
||||
:okExec
|
||||
|
||||
rem Get remaining unshifted command line arguments and save them in the
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
call "%EXECUTABLE%" stop %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
31
tomcat/bin/shutdown.sh
Normal file
31
tomcat/bin/shutdown.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Stop script for the CATALINA Server
|
||||
#
|
||||
# $Id: shutdown.sh,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
EXECUTABLE=catalina.sh
|
||||
|
||||
# Check that target executable exists
|
||||
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
|
||||
echo "Cannot find $PRGDIR/$EXECUTABLE"
|
||||
echo "This file is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$PRGDIR"/"$EXECUTABLE" stop "$@"
|
39
tomcat/bin/startup-using-launcher.bat
Normal file
39
tomcat/bin/startup-using-launcher.bat
Normal file
|
@ -0,0 +1,39 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem
|
||||
rem Script for starting Catalina using the Launcher
|
||||
rem
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Get standard environment variables
|
||||
set PRG=%0
|
||||
if exist %PRG%\..\setenv.bat goto gotCmdPath
|
||||
rem %0 must have been found by DOS using the %PATH% so we assume that
|
||||
rem setenv.bat will also be found in the %PATH%
|
||||
goto doneSetenv
|
||||
:gotCmdPath
|
||||
call %PRG%\..\setenv.bat
|
||||
:doneSetenv
|
||||
|
||||
rem Make sure prerequisite environment variables are set
|
||||
if not "%JAVA_HOME%" == "" goto gotJavaHome
|
||||
echo The JAVA_HOME environment variable is not defined
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:gotJavaHome
|
||||
|
||||
rem Get command line arguments and save them with the proper quoting
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
rem Execute the Launcher using the "catalina" target
|
||||
"%JAVA_HOME%\bin\java.exe" -classpath %PRG%\..;"%PATH%";. LauncherBootstrap -launchfile catalina.xml -verbose catalina %CMD_LINE_ARGS% start
|
||||
|
||||
:end
|
29
tomcat/bin/startup-using-launcher.sh
Normal file
29
tomcat/bin/startup-using-launcher.sh
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# Script for starting Catalina using the Launcher
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
# Get standard environment variables
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
if [ -r "$PRGDIR"/setenv.sh ]; then
|
||||
. "$PRGDIR"/setenv.sh
|
||||
fi
|
||||
|
||||
# Execute the Launcher using the "catalina" target
|
||||
exec "$JAVA_HOME"/bin/java -classpath "$PRGDIR" LauncherBootstrap -launchfile catalina.xml -verbose catalina "$@" start
|
44
tomcat/bin/startup.bat
Normal file
44
tomcat/bin/startup.bat
Normal file
|
@ -0,0 +1,44 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem Start script for the CATALINA Server
|
||||
rem
|
||||
rem $Id: startup.bat,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
set CURRENT_DIR=%cd%
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=%CURRENT_DIR%
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
cd ..
|
||||
set CATALINA_HOME=%cd%
|
||||
cd %CURRENT_DIR%
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
echo The CATALINA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
|
||||
set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat
|
||||
|
||||
rem Check that target executable exists
|
||||
if exist "%EXECUTABLE%" goto okExec
|
||||
echo Cannot find %EXECUTABLE%
|
||||
echo This file is needed to run this program
|
||||
goto end
|
||||
:okExec
|
||||
|
||||
rem Get remaining unshifted command line arguments and save them in the
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
31
tomcat/bin/startup.sh
Normal file
31
tomcat/bin/startup.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Start Script for the CATALINA Server
|
||||
#
|
||||
# $Id: startup.sh,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
EXECUTABLE=catalina.sh
|
||||
|
||||
# Check that target executable exists
|
||||
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
|
||||
echo "Cannot find $PRGDIR/$EXECUTABLE"
|
||||
echo "This file is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$PRGDIR"/"$EXECUTABLE" start "$@"
|
BIN
tomcat/bin/tomcat5.exe
Normal file
BIN
tomcat/bin/tomcat5.exe
Normal file
Binary file not shown.
BIN
tomcat/bin/tomcat5w.exe
Normal file
BIN
tomcat/bin/tomcat5w.exe
Normal file
Binary file not shown.
40
tomcat/bin/tool-wrapper-using-launcher.bat
Normal file
40
tomcat/bin/tool-wrapper-using-launcher.bat
Normal file
|
@ -0,0 +1,40 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem
|
||||
rem Script for running the Catalina tool wrapper using the Launcher
|
||||
rem
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Get standard environment variables
|
||||
set PRG=%0
|
||||
if exist %PRG%\..\setenv.bat goto gotCmdPath
|
||||
rem %0 must have been found by DOS using the %PATH% so we assume that
|
||||
rem setenv.bat will also be found in the %PATH%
|
||||
call setenv.bat
|
||||
goto doneSetenv
|
||||
:gotCmdPath
|
||||
call %PRG%\..\setenv.bat
|
||||
:doneSetenv
|
||||
|
||||
rem Make sure prerequisite environment variables are set
|
||||
if not "%JAVA_HOME%" == "" goto gotJavaHome
|
||||
echo The JAVA_HOME environment variable is not defined
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:gotJavaHome
|
||||
|
||||
rem Get command line arguments and save them with the proper quoting
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
rem Execute the Launcher using the "tool-wrapper" target
|
||||
"%JAVA_HOME%\bin\java.exe" -classpath %PRG%\..;"%PATH%";. LauncherBootstrap -launchfile catalina.xml -verbose tool-wrapper %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
29
tomcat/bin/tool-wrapper-using-launcher.sh
Normal file
29
tomcat/bin/tool-wrapper-using-launcher.sh
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# Script for running the Catalina tool wrapper using the Launcher
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
# Get standard environment variables
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
if [ -r "$PRGDIR"/setenv.sh ]; then
|
||||
. "$PRGDIR"/setenv.sh
|
||||
fi
|
||||
|
||||
# Execute the Launcher using the "tool-wrapper" target
|
||||
exec "$JAVA_HOME"/bin/java -classpath "$PRGDIR" LauncherBootstrap -launchfile catalina.xml -verbose tool-wrapper "$@"
|
59
tomcat/bin/tool-wrapper.bat
Normal file
59
tomcat/bin/tool-wrapper.bat
Normal file
|
@ -0,0 +1,59 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem Wrapper script for command line tools
|
||||
rem
|
||||
rem Environment Variable Prequisites
|
||||
rem
|
||||
rem CATALINA_HOME May point at your Catalina "build" directory.
|
||||
rem
|
||||
rem TOOL_OPTS (Optional) Java runtime options used when the "start",
|
||||
rem "stop", or "run" command is executed.
|
||||
rem
|
||||
rem JAVA_HOME Must point at your Java Development Kit installation.
|
||||
rem
|
||||
rem JAVA_OPTS (Optional) Java runtime options used when the "start",
|
||||
rem "stop", or "run" command is executed.
|
||||
rem
|
||||
rem $Id: tool-wrapper.bat,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=.
|
||||
if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
|
||||
set CATALINA_HOME=..
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome
|
||||
echo The CATALINA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
|
||||
rem Get standard environment variables
|
||||
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
|
||||
|
||||
rem Get standard Java environment variables
|
||||
if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
|
||||
echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
|
||||
echo This file is needed to run this program
|
||||
goto end
|
||||
:okSetclasspath
|
||||
set BASEDIR=%CATALINA_HOME%
|
||||
call "%CATALINA_HOME%\bin\setclasspath.bat"
|
||||
|
||||
rem Add on extra jar files to CLASSPATH
|
||||
set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar;"%BASEDIR%"\common\lib\jmx.jar
|
||||
|
||||
rem Get remaining unshifted command line arguments and save them in the
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
78
tomcat/bin/tool-wrapper.sh
Normal file
78
tomcat/bin/tool-wrapper.sh
Normal file
|
@ -0,0 +1,78 @@
|
|||
#!/bin/sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Wrapper script for command line tools
|
||||
#
|
||||
# Environment Variable Prequisites
|
||||
#
|
||||
# CATALINA_HOME May point at your Catalina "build" directory.
|
||||
#
|
||||
# TOOL_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.
|
||||
#
|
||||
# JAVA_OPTS (Optional) Java runtime options used when the "start",
|
||||
# "stop", or "run" command is executed.
|
||||
#
|
||||
# $Id: tool-wrapper.sh,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true;;
|
||||
esac
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
# Get standard environment variables
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
|
||||
if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
|
||||
. "$CATALINA_HOME"/bin/setenv.sh
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
|
||||
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# Get standard Java environment variables
|
||||
if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
|
||||
BASEDIR="$CATALINA_HOME"
|
||||
. "$CATALINA_HOME"/bin/setclasspath.sh
|
||||
else
|
||||
echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh"
|
||||
echo "This file is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add on extra jar files to CLASSPATH
|
||||
CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$BASEDIR"/common/lib/jmx.jar
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
CATALINA_HOME=`cygpath --path --windows "$CATALINA_HOME"`
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# ----- Execute The Requested Command -----------------------------------------
|
||||
|
||||
exec "$_RUNJAVA" $JAVA_OPTS $TOOL_OPTS \
|
||||
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
|
||||
-Dcatalina.home="$CATALINA_HOME" \
|
||||
org.apache.catalina.startup.Tool "$@"
|
44
tomcat/bin/version.bat
Normal file
44
tomcat/bin/version.bat
Normal file
|
@ -0,0 +1,44 @@
|
|||
@echo off
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem Version script for the CATALINA Server
|
||||
rem
|
||||
rem $Id: version.bat,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
rem Guess CATALINA_HOME if not defined
|
||||
set CURRENT_DIR=%cd%
|
||||
if not "%CATALINA_HOME%" == "" goto gotHome
|
||||
set CATALINA_HOME=%CURRENT_DIR%
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
cd ..
|
||||
set CATALINA_HOME=%cd%
|
||||
cd %CURRENT_DIR%
|
||||
:gotHome
|
||||
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
|
||||
echo The CATALINA_HOME environment variable is not defined correctly
|
||||
echo This environment variable is needed to run this program
|
||||
goto end
|
||||
:okHome
|
||||
|
||||
set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat
|
||||
|
||||
rem Check that target executable exists
|
||||
if exist "%EXECUTABLE%" goto okExec
|
||||
echo Cannot find %EXECUTABLE%
|
||||
echo This file is needed to run this program
|
||||
goto end
|
||||
:okExec
|
||||
|
||||
rem Get remaining unshifted command line arguments and save them in the
|
||||
set CMD_LINE_ARGS=
|
||||
:setArgs
|
||||
if ""%1""=="""" goto doneSetArgs
|
||||
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
|
||||
shift
|
||||
goto setArgs
|
||||
:doneSetArgs
|
||||
|
||||
call "%EXECUTABLE%" version %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
31
tomcat/bin/version.sh
Normal file
31
tomcat/bin/version.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
# -----------------------------------------------------------------------------
|
||||
# Version Script for the CATALINA Server
|
||||
#
|
||||
# $Id: version.sh,v 1.1 2005/02/21 06:54:23 amontano Exp $
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$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
|
||||
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
EXECUTABLE=catalina.sh
|
||||
|
||||
# Check that target executable exists
|
||||
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
|
||||
echo "Cannot find $PRGDIR/$EXECUTABLE"
|
||||
echo "This file is needed to run this program"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$PRGDIR"/"$EXECUTABLE" version "$@"
|
Loading…
Add table
Add a link
Reference in a new issue