tomcat java启动参数_tomcat端口修改以及jvm启动参数设置

SET JAVA_HOME=....jdk1.7.0_60x64

SET JAVA_OPTS=-server -Xmx8g -Xms8g -XX:MaxPermSize=2048m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseConcMarkSweepGC -Xloggc:e:/JVM_GC_XXX_8080.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps

@echo off

rem Licensed to the Apache Software Foundation (ASF) under one or more

rem contributor license agreements. See the NOTICE file distributed with

remthis work foradditional information regarding copyright ownership.

rem The ASF licensesthis file to You under the Apache License, Version 2.0rem (the"License"); you may not use thisfile 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 Licenseforthe specific language governing permissions and

rem limitations under the License.

rem---------------------------------------------------------------------------rem Start/Stop Script forthe CATALINA Server

rem

rem Environment Variable Prerequisites

rem

rem Do not set the variables inthisscript. Instead put them into a script

rem setenv.bat in CATALINA_BASE/bin to keep your customizations separate.

rem

rem WHEN RUNNING TOMCAT AS A WINDOWS SERVICE:

rem Note that the environment variables that affect the behavior ofthisrem script will have no effect at all on Windows Services. As such, any

rem local customizations made in a CATALINA_BASE/bin/setenv.bat script

rem will also have no effect on Tomcat when launched as a Windows Service.

rem The configuration that controls Windows Services is stored in the Windows

rem Registry, and is most conveniently maintained using the"tomcatXw.exe"rem maintenance utility, where"X"is the major version of Tomcat you are

rem running.

rem

rem CATALINA_HOME May point at your Catalina"build"directory.

rem

rem CATALINA_BASE (Optional) Base directoryforresolving 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"run" or "debug"command is executed.

rem Include here and not in JAVA_OPTS all options, that should

rem only be used by Tomcat itself, not by the stop process,

rem the version command etc.

rem Examples are heap size, GC logging, JMX ports etc.

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 Required to run the with the"debug"argument.

rem

rem JRE_HOME Must point at your Java Runtime installation.

rem Defaults to JAVA_HOMEifempty. If JRE_HOME and JAVA_HOME

rem are both set, JRE_HOME is used.

rem

rem JAVA_OPTS (Optional) Java runtime options used when any command

rem is executed.

rem Include here and not in CATALINA_OPTS all options, that

rem should be used by Tomcat and also by the stop process,

rem the version command etc.

rem Most options should go into CATALINA_OPTS.

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. Thedefault is "dt_socket".

rem

rem JPDA_ADDRESS (Optional) Java runtime options used when the"jpda start"rem command is executed. Thedefault 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. Thedefaultis:

rem

rem-agentlib:jdwp=transport=%JPDA_TRANSPORT%,

rem address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%rem

rem JSSE_OPTS (Optional) Java runtime options used to control the TLS

rem implementation when JSSE is used. Default is:

rem"-Djdk.tls.ephemeralDHKeySize=2048"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=%CATALINA_BASE%conflogging.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. Thedefaultrem TITLE is Tomcatif it's not specified.

rem Example (all one line)

rem set TITLE=Tomcat.Cluster#1.Server#1 [%DATE% %TIME%]

rem---------------------------------------------------------------------------setlocal

rem Suppress Terminate batch job on CTRL+Cif not ""%1"" == ""run"" gotomainEntryif "%TEMP%" == "" gotomainEntryif exist "%TEMP%%~nx0.run" gotomainEntry

echo Y>"%TEMP%%~nx0.run"

if not exist "%TEMP%%~nx0.run" gotomainEntry

echo Y>"%TEMP%%~nx0.Y"call"%~f0" %*

set RETVAL=%ERRORLEVEL%del/Q "%TEMP%%~nx0.Y" >NUL 2>&1exit/B %RETVAL%:mainEntry

del/Q "%TEMP%%~nx0.run" >NUL 2>&1rem Guess CATALINA_HOMEifnot defined

set"CURRENT_DIR=%cd%"

if not "%CATALINA_HOME%" == "" gotogotHome

set"CATALINA_HOME=%CURRENT_DIR%"

if exist "%CATALINA_HOME%bincatalina.bat" gotookHome

cd ..

set"CATALINA_HOME=%cd%"cd"%CURRENT_DIR%":gotHomeif exist "%CATALINA_HOME%bincatalina.bat" gotookHome

echo The CATALINA_HOME environment variable is not defined correctly

echo This environment variable is needed to runthisprogramgotoend

:okHome

rem Copy CATALINA_BASE from CATALINA_HOMEifnot definedif not "%CATALINA_BASE%" == "" gotogotBase

set"CATALINA_BASE=%CATALINA_HOME%":gotBase

rem Ensure that any user defined CLASSPATH variables are not used on startup,

rem but allow them to be specified in setenv.bat, in rarecasewhen it is needed.

set CLASSPATH=rem Get standard environment variablesif not exist "%CATALINA_BASE%binsetenv.bat" gotocheckSetenvHome

call"%CATALINA_BASE%binsetenv.bat"

gotosetenvDone

:checkSetenvHomeif exist "%CATALINA_HOME%binsetenv.bat" call "%CATALINA_HOME%binsetenv.bat":setenvDone

rem Get standard Java environment variablesif exist "%CATALINA_HOME%binsetclasspath.bat" gotookSetclasspath

echo Cannot find"%CATALINA_HOME%binsetclasspath.bat"echo This file is needed to runthisprogramgotoend

:okSetclasspath

call"%CATALINA_HOME%binsetclasspath.bat" %1

if errorlevel 1 gotoend

rem Add on extra jar file to CLASSPATH

rem Note that there are no quotes as wedonot want to introduce random

rem quotes into the CLASSPATHif "%CLASSPATH%" == "" gotoemptyClasspath

set"CLASSPATH=%CLASSPATH%;":emptyClasspath

set"CLASSPATH=%CLASSPATH%%CATALINA_HOME%binbootstrap.jar"

if not "%CATALINA_TMPDIR%" == "" gotogotTmpdir

set"CATALINA_TMPDIR=%CATALINA_BASE%temp":gotTmpdir

rem Add tomcat-juli.jar to classpath

rem tomcat-juli.jar can be over-ridden per instanceif not exist "%CATALINA_BASE%bintomcat-juli.jar" gotojuliClasspathHome

set"CLASSPATH=%CLASSPATH%;%CATALINA_BASE%bintomcat-juli.jar"

gotojuliClasspathDone

:juliClasspathHome

set"CLASSPATH=%CLASSPATH%;%CATALINA_HOME%bintomcat-juli.jar":juliClasspathDoneif not "%JSSE_OPTS%" == "" gotogotJsseOpts

set JSSE_OPTS="-Djdk.tls.ephemeralDHKeySize=2048":gotJsseOpts

set"JAVA_OPTS=%JAVA_OPTS% %JSSE_OPTS%"

if not "%LOGGING_CONFIG%" == "" gotonoJuliConfig

set LOGGING_CONFIG=-Dnopif not exist "%CATALINA_BASE%conflogging.properties" gotonoJuliConfig

set LOGGING_CONFIG=-Djava.util.logging.config.file="%CATALINA_BASE%conflogging.properties":noJuliConfig

set"JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%"

if not "%LOGGING_MANAGER%" == "" gotonoJuliManager

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:"%CATALINA_BASE%"echo Using CATALINA_HOME:"%CATALINA_HOME%"echo Using CATALINA_TMPDIR:"%CATALINA_TMPDIR%"

if ""%1"" == ""debug"" gotouse_jdk

echo Using JRE_HOME:"%JRE_HOME%"

gotojava_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"" gotonoJpda

set JPDA=jpdaif not "%JPDA_TRANSPORT%" == "" gotogotJpdaTransport

set JPDA_TRANSPORT=dt_socket

:gotJpdaTransportif not "%JPDA_ADDRESS%" == "" gotogotJpdaAddress

set JPDA_ADDRESS=8000:gotJpdaAddressif not "%JPDA_SUSPEND%" == "" gotogotJpdaSuspend

set JPDA_SUSPEND=n

:gotJpdaSuspendif not "%JPDA_OPTS%" == "" gotogotJpdaOpts

set JPDA_OPTS=-agentlib:jdwp=transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%:gotJpdaOpts

shift

:noJpdaif ""%1"" == ""debug"" gotodoDebugif ""%1"" == ""run"" gotodoRunif ""%1"" == ""start"" gotodoStartif ""%1"" == ""stop"" gotodoStopif ""%1"" == ""configtest"" gotodoConfigTestif ""%1"" == ""version"" gotodoVersion

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 configtest Run a basic syntax check on server.xml

echo version What version of tomcat are you running?

gotoend

:doDebug

shift

set _EXECJAVA=%_RUNJDB%set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%....java"

if not ""%1"" == ""-security"" gotoexecCmd

shift

echo Using Security Manager

set"SECURITY_POLICY_FILE=%CATALINA_BASE%confcatalina.policy"

gotoexecCmd

:doRun

shiftif not ""%1"" == ""-security"" gotoexecCmd

shift

echo Using Security Manager

set"SECURITY_POLICY_FILE=%CATALINA_BASE%confcatalina.policy"

gotoexecCmd

:doStart

shiftif "%TITLE%" == "" set TITLE=Tomcat

set _EXECJAVA=start "%TITLE%" %_RUNJAVA%

if not ""%1"" == ""-security"" gotoexecCmd

shift

echo Using Security Manager

set"SECURITY_POLICY_FILE=%CATALINA_BASE%confcatalina.policy"

gotoexecCmd

:doStop

shift

set ACTION=stop

set CATALINA_OPTS=

gotoexecCmd

:doConfigTest

shift

set ACTION=configtest

set CATALINA_OPTS=

gotoexecCmd

:doVersion%_EXECJAVA% -classpath "%CATALINA_HOME%libcatalina.jar"org.apache.catalina.util.ServerInfogotoend

:execCmd

rem Get remaining unshifted command line arguments and save them in the

set CMD_LINE_ARGS=:setArgsif ""%1""=="""" gotodoneSetArgs

set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1shiftgotosetArgs

:doneSetArgs

rem Execute Java with the applicable propertiesif not "%JPDA%" == "" gotodoJpdaif not "%SECURITY_POLICY_FILE%" == "" gotodoSecurity%_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%

gotoend

: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%

gotoend

:doJpdaif not "%SECURITY_POLICY_FILE%" == "" gotodoSecurityJpda%_EXECJAVA% %JAVA_OPTS% %JPDA_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%

gotoend

:doSecurityJpda%_EXECJAVA% %JAVA_OPTS% %JPDA_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%

gotoend

:end

#以上红色部分则为参数设置。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值