非安裝版tomcat 配置文件修改…
catalina.bat文件內容:
@echo off
JAVA_OPTS="-server -XX:PermSize=1024M
-XX:MaxPermSize=2048m"
rem Licensed to the Apache Software Foundation (ASF) under one
or more
rem contributor license agreements. See the
NOTICE file distributed with
rem this work for additional information regarding copyright
ownership.
rem The ASF licenses this file to You under the Apache
License, Version 2.0
rem (the "License"); you may not use this file except in
compliance with
rem the License. You may obtain a copy of
the License at
rem
rem
http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing,
software
rem distributed under the License is distributed on an "AS IS"
BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.
rem See the License for the specific language governing
permissions and
rem limitations under the License.
if "%OS%" == "Windows_NT" setlocal
rem
---------------------------------------------------------------------------
rem Start/Stop Script for the CATALINA Server
rem
rem Environment Variable Prerequisites
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
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
�TALINA_BASE%\temp.
rem
rem JAVA_HOME
Must point at your Java
Development Kit installation.
rem
Required
to run the with the "debug" argument.
rem
rem JRE_HOME
Must point
at your Java Runtime installation.
rem
Defaults
to JAVA_HOME if empty.
rem
rem JAVA_OPTS
(Optional) Java runtime
options used when the "start",
rem
"stop", or
"run" command is executed.
rem
rem JAVA_ENDORSED_DIRS (Optional) Lists of
of semi-colon separated directories
rem
containing
some jars in order to allow replacement of
APIs
rem
created
outside of the JCP (i.e. DOM and SAX from
W3C).
rem
It can
also be used to update the XML parser implementation.
rem
Defaults
to $CATALINA_HOME/endorsed.
rem
rem JPDA_TRANSPORT
(Optional) JPDA transport used when the "jpda
start"
rem
command is
executed. The default is "dt_socket".
rem
rem JPDA_ADDRESS
(Optional) Java runtime options used when the
"jpda start"
rem
command is
executed. The default is 8000.
rem
rem JPDA_SUSPEND
(Optional) Java runtime options used when the
"jpda start"
rem
command is
executed. Specifies whether JVM should suspend
rem
execution
immediately after startup. Default is "n".
rem
rem JPDA_OPTS
(Optional) Java runtime
options used when the "jpda start"
rem
command is
executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
rem
and
JPDA_SUSPEND are ignored. Thus, all required jpda
rem
options
MUST be specified. The default is:
rem
rem
-agentlib:jdwp=transport=%JPDA_TRANSPORT%,
rem
address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
rem
rem LOGGING_CONFIG
(Optional) Override Tomcat's logging config
file
rem
Example
(all one line)
rem
set
LOGGING_CONFIG="-Djava.util.logging.config.file=�TALINA_BASE%\conf\logging.properties"
rem
rem LOGGING_MANAGER (Optional) Override
Tomcat's logging manager
rem
Example
(all one line)
rem
set
LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
rem
rem TITLE
(Optional) Specify the title of Tomcat window.
The default
rem
TITLE is
Tomcat if it's not specified.
rem
Example
(all one line)
rem
set
TITLE=Tomcat.Cluster#1.Server#1 [�TE% %TIME%]
rem
rem
rem
rem $Id: catalina.bat 1040547 2010-11-30 14:47:49Z markt
$
rem
---------------------------------------------------------------------------
rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=�%"
if not "�TALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "�TALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set "CATALINA_HOME=�%"
cd "%CURRENT_DIR%"
:gotHome
if exist "�TALINA_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 Ensure that any user defined CLASSPATH variables are not
used on startup,
rem but allow them to be specified in setenv.bat, in rare case
when it is needed.
set CLASSPATH=
rem Get standard environment variables
if "�TALINA_BASE%" == "" goto gotSetenvHome
if exist "�TALINA_BASE%\bin\setenv.bat" call
"�TALINA_BASE%\bin\setenv.bat"
goto gotSetenvBase
:gotSetenvHome
if exist "�TALINA_HOME%\bin\setenv.bat" call
"�TALINA_HOME%\bin\setenv.bat"
:gotSetenvBase
rem Get standard Java environment variables
if exist "�TALINA_HOME%\bin\setclasspath.bat" goto
okSetclasspath
echo Cannot find "�TALINA_HOME%\bin\setclasspath.bat"
echo This file is needed to run this program
goto end
:okSetclasspath
set "BASEDIR=�TALINA_HOME%"
call "�TALINA_HOME%\bin\setclasspath.bat" %1
if errorlevel 1 goto end
if not "�TALINA_BASE%" == "" goto gotBase
set "CATALINA_BASE=�TALINA_HOME%"
:gotBase
if not "�TALINA_TMPDIR%" == "" goto gotTmpdir
set "CATALINA_TMPDIR=�TALINA_BASE%\temp"
:gotTmpdir
rem Add tomcat-juli.jar and bootstrap.jar to classpath
rem tomcat-juli.jar can be over-ridden per instance
rem Note that there are no quotes as we do not want to
introduce random
rem quotes into the CLASSPATH
if "%CLASSPATH%" == "" goto emptyClasspath
set "CLASSPATH=%CLASSPATH%;"
:emptyClasspath
if "�TALINA_BASE%" == "�TALINA_HOME%" goto
juliClasspathHome
if not exist "�TALINA_BASE%\bin\tomcat-juli.jar" goto
juliClasspathHome
set
"CLASSPATH=%CLASSPATH%�TALINA_BASE%\bin\tomcat-juli.jar;�TALINA_HOME%\bin\bootstrap.jar"
goto juliClasspathDone
:juliClasspathHome
set
"CLASSPATH=%CLASSPATH%�TALINA_HOME%\bin\bootstrap.jar"
:juliClasspathDone
if not "%LOGGING_CONFIG%" == "" goto noJuliConfig
set LOGGING_CONFIG=-Dnop
if not exist "�TALINA_BASE%\conf\logging.properties" goto
noJuliConfig
set
LOGGING_CONFIG=-Djava.util.logging.config.file="�TALINA_BASE%\conf\logging.properties"
:noJuliConfig
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
if not "%LOGGING_MANAGER%" == "" goto noJuliManager
set
LOGGING_MANAGER=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%
rem ----- Execute The Requested Command
---------------------------------------
echo Using CATALINA_BASE:
"�TALINA_BASE%"
echo Using CATALINA_HOME:
"�TALINA_HOME%"
echo Using CATALINA_TMPDIR: "�TALINA_TMPDIR%"
if ""%1"" == ""debug"" goto use_jdk
echo Using JRE_HOME:
"%JRE_HOME%"
goto java_dir_displayed
:use_jdk
echo Using JAVA_HOME:
"%JAVA_HOME%"
:java_dir_displayed
echo Using CLASSPATH:
"%CLASSPATH%"
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_socket
:gotJpdaTransport
if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
set JPDA_ADDRESS=8000
:gotJpdaAddress
if not "%JPDA_SUSPEND%" == "" goto gotJpdaSuspend
set JPDA_SUSPEND=n
:gotJpdaSuspend
if not "%JPDA_OPTS%" == "" goto gotJpdaOpts
set
JPDA_OPTS=-agentlib:jdwp=transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
:gotJpdaOpts
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 "�TALINA_HOME%\..\..\java"
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set
"SECURITY_POLICY_FILE=�TALINA_BASE%\conf\catalina.policy"
goto execCmd
:doRun
shift
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set
"SECURITY_POLICY_FILE=�TALINA_BASE%\conf\catalina.policy"
goto execCmd
:doStart
shift
if not "%OS%" == "Windows_NT" goto noTitle
if "%TITLE%" == "" set TITLE=Tomcat
set _EXECJAVA=start "%TITLE%" %_RUNJAVA%
goto gotTitle
:noTitle
set _EXECJAVA=start %_RUNJAVA%
:gotTitle
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set
"SECURITY_POLICY_FILE=�TALINA_BASE%\conf\catalina.policy"
goto execCmd
:doStop
shift
set ACTION=stop
set CATALINA_OPTS=
goto execCmd
:doVersion
%_EXECJAVA% -classpath "�TALINA_HOME%\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% �TALINA_OPTS% �BUG_OPTS%
-Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath
"%CLASSPATH%" -Dcatalina.base="�TALINA_BASE%"
-Dcatalina.home="�TALINA_HOME%" -Djava.io.tmpdir="�TALINA_TMPDIR%"
%MAINCLASS% %CMD_LINE_ARGS% �TION%
goto end
:doSecurity
%_EXECJAVA% %JAVA_OPTS% �TALINA_OPTS% �BUG_OPTS%
-Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath
"%CLASSPATH%" -Djava.security.manager
-Djava.security.policy=="%SECURITY_POLICY_FILE%"
-Dcatalina.base="�TALINA_BASE%" -Dcatalina.home="�TALINA_HOME%"
-Djava.io.tmpdir="�TALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS%
�TION%
goto end
:doJpda
if not "%SECURITY_POLICY_FILE%" == "" goto
doSecurityJpda
%_EXECJAVA% %JAVA_OPTS% �TALINA_OPTS% %JPDA_OPTS% �BUG_OPTS%
-Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath
"%CLASSPATH%" -Dcatalina.base="�TALINA_BASE%"
-Dcatalina.home="�TALINA_HOME%" -Djava.io.tmpdir="�TALINA_TMPDIR%"
%MAINCLASS% %CMD_LINE_ARGS% �TION%
goto end
:doSecurityJpda
%_EXECJAVA% %JAVA_OPTS% �TALINA_OPTS% %JPDA_OPTS% �BUG_OPTS%
-Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath
"%CLASSPATH%" -Djava.security.manager
-Djava.security.policy=="%SECURITY_POLICY_FILE%"
-Dcatalina.base="�TALINA_BASE%" -Dcatalina.home="�TALINA_HOME%"
-Djava.io.tmpdir="�TALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS%
�TION%
goto end
:end
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.