Tomcat 7实例无法启动:用法catalina.sh

时间:2016-03-22 14:51:47

标签: linux tomcat multiple-instances

我尝试在CENTOS7上安装tomcat7实例。

我在我的实例文件夹(例程)中写了这个脚本:

export CATALINA_HOME=/usr/local/tomcat7
export CATALINA_BASE=/opt/tc7-instances/test/tomcat7
export JRE_HOME=/usr/java/jdk1.8.0_60/jre/bin/java
cd $CATALINA_HOME/bin
./startup.sh

但是当我运行它时,我收到了这条消息:

Using CATALINA_BASE:   /opt/tc7-instances/test/tomcat7
Using CATALINA_HOME:   /usr/local/tomcat7
Using CATALINA_TMPDIR: /opt/tc7-instances/test/tomcat7/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_60/jre/bin/java
Using CLASSPATH:       /usr/local/tomcat7/bin/bootstrap.jar:/opt/tc7-instances/test/tomcat7/bin/tomcat-juli.jar
Usage: catalina.sh ( commands ... )
commands:
debug             Start Catalina in a debugger
debug -security   Debug Catalina with a security manager
jpda start        Start Catalina under JPDA debugger
run               Start Catalina in the current window
run -security     Start in the current window with security manager
start             Start Catalina in a separate window
start -security   Start in a separate window with security manager
stop              Stop Catalina, waiting up to 5 seconds for the process to end
stop n            Stop Catalina, waiting up to n seconds for the process to end
stop -force       Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running
stop n -force     Stop Catalina, wait up to n seconds and then use kill -KILL if still running
configtest        Run a basic syntax check on server.xml - check exit code for result
version           What version of tomcat are you running?
Note: Waiting for the process to end and use of the -force option require that $CATALINA_PID is defined

但我已按照说明操作:https://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt 我已经更新了实例xml文件,如下所示: http://linoxide.com/linux-how-to/install-tomcat-8-centos-7/

在我的脚本中,如果我用./catalina.sh启动改变./startup.sh,我会遇到同样的问题..

我不明白是什么问题

2 个答案:

答案 0 :(得分:1)

看起来你已经混淆了环境变量扩展的$和%。试试这个:

set JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs=/opt/tc7-instances/test/tomcat7/endorsed"
set JAVA_OPTS="$JAVA_OPTS -Djava.io.tmpdir=/opt/tc7-instances/test/tomcat7/temp"
set JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
set JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.config.file=/opt/tc7-instances/test/tomcat7/conf/logging.properties"
set JAVA_OPTS="$JAVA_OPTS -Dprop_locator=/opt/tc7-instances/test/conf/database.properties"
set JAVA_OPTS="$JAVA_OPTS -Dlog4j_locator=/opt/tc7-instances/test/conf/log4j.properties"
set JAVA_OPTS="$JAVA_OPTS -Dcsd.env=dev"
set JAVA_OPTS="$JAVA_OPTS -Xms128m"
set JAVA_OPTS="$JAVA_OPTS -Xmx1024m"
set JAVA_OPTS="$JAVA_OPTS -XX:PermSize=64m"
set JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=256m"
set JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"

答案 1 :(得分:0)

所以,

阅读此帖后:http://ubuntuforums.org/showthread.php?t=2032330

我认为问题来自我的setenv.sh,位于我的实例的bin文件夹中。

setenv.sh:

set JAVA_OPTS=%JAVA_OPTS% -Djava.endorsed.dirs=/opt/tc7-instances/test/tomcat7/endorsed
set JAVA_OPTS=%JAVA_OPTS% -Djava.io.tmpdir=/opt/tc7-instances/test/tomcat7/temp
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.config.file=/opt/tc7-instances/test/tomcat7/conf/logging.properties
set JAVA_OPTS=%JAVA_OPTS% -Dprop_locator=/opt/tc7-instances/test/conf/database.properties
set JAVA_OPTS=%JAVA_OPTS% -Dlog4j_locator=/opt/tc7-instances/test/conf/log4j.properties
set JAVA_OPTS=%JAVA_OPTS% -Dcsd.env=dev
set JAVA_OPTS=%JAVA_OPTS% -Xms128m
set JAVA_OPTS=%JAVA_OPTS% -Xmx1024m
set JAVA_OPTS=%JAVA_OPTS% -XX:PermSize=64m
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256m
set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8

我要在运行主脚本之前评论不同的命令,以隔离​​产生问题的命令