catalinash配置文件
Catalina.sh是Apache Tomcat的启动脚本,它负责启动Tomcat服务器。该文件包含了许多配置参数,可以根据需要进行修改。以下是一个示例Catalina.sh配置文件:
#!/bin/sh
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----------------------------------------------------------------------------
Control Script for the CATALINA Server
Environment Variable Prerequisites
Do not set the variables in this script. Instead put them into a script
setenv.sh in CATALINA_BASE/bin to keep your customizations separate.
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.
-----------------------------------------------------------------------------
Start/Stop Script for the CATALINA Server
Run this script with the command
"catalina.sh [command]"
where [command] is one of:
start Start Catalina in a separate window
start-debug Start in Java debug mode
start-security Start with security manager and policy files
stop Stop Catalina
stop-force Stop Catalina (followed by process kill if necessary)
run Start Catalina in the current window
version What version of tomcat are you running?
configtest Test the configuration files and exit
validate Check the configuration files for syntax errors
help Display this help screen
-----------------------------------------------------------------------------
Guess CATALINA_HOME if not defined
-----------------------------------------------------------------------------
if [ -z "$CATALINA_HOME" ]; then
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
CATALINA_HOME=dirname "$PRG"/..
make it fully qualified
CATALINA_HOME=cd "$CATALINA_HOME" && pwd
fi
-----------------------------------------------------------------------------
Guess CATALINA_BASE if not defined
-----------------------------------------------------------------------------
if [ -z "$CATALINA_BASE" ]; then CATALINA_BASE="$CATALINA_HOME" fi
-----------------------------------------------------------------------------
Set JVM memory options
-----------------------------------------------------------------------------
if [ -z "$JAVA_OPTS" ]; then JAVA_OPTS="-Xms512m -Xmx1024m -XX:MaxPermSize=256m -Djava.awt.headless=true -Dfile.encoding=UTF-8" fi
-----------------------------------------------------------------------------
Add tomcat-juli.jar to CLASSPATH
-----------------------------------------------------------------------------
if [ -z "$CLASSPATH" ]; then CLASSPATH="$CATALINA_HOME/bin/tomcat-juli.jar" else CLASSPATH="$CATALINA_HOME/bin/tomcat-juli.jar:$CLASSPATH" fi
-----------------------------------------------------------------------------
Set Tomcat options
-----------------------------------------------------------------------------
CATALINA_OPTS="-Djava.library.path=$CATALINA_HOME/lib"
-----------------------------------------------------------------------------
Ensure that any user defined CLASSPATH variables are not used on startup
-----------------------------------------------------------------------------
unset CLASSPATH
-----------------------------------------------------------------------------
Set the temporary directory to use
-----------------------------------------------------------------------------
if [ -z "$CATALINA_TMPDIR" ]; then CATALINA_TMPDIR="$CATALINA_BASE/temp" fi
-----------------------------------------------------------------------------
Execute the command
-----------------------------------------------------------------------------
"$CATALINA_HOME"/bin/catalina.sh "$@
原文地址: https://www.cveoy.top/t/topic/dwVU 著作权归作者所有。请勿转载和采集!