我正在尝试按照说明在远程 Ubuntu 14.04 上安装并运行 tomcat 8这个帖子。
我的tomcat.conf
文件如下:描述“Tomcat服务器”
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
setuid tomcat
setgid tomcat
env JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre/bin/java
env CATALINA_HOME=/opt/tomcat
# Modify these options as needed
env JAVA_OPTS="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
env CATALINA_OPTS="-Xms256M -Xmx512M -server -XX:+UseParallelGC"
exec $CATALINA_HOME/bin/catalina.sh run
# cleanup temp directory after stop
post-stop script
rm -rf $CATALINA_HOME/temp/*
end script
保存后我运行了sudo initctl reload-configuration
但sudo initctl start tomcat
收到消息:
tomcat start/post-stop, process 1259
显然 tomcat 没有启动,当我运行时sudo initctl status tomcat
我收到消息:
tomcat stop/waiting
我错过了什么?
答案1
可能是权限问题,检查/var/log/upstart/tomcat.log,可能会发现这样的日志:
/bin/sh: 1: exec: /opt/tomcat/bin/catalina.sh: Permission denied
要修复所有这些权限问题,请执行以下操作:
sudo chown -R tomcat:tomcat /opt/tomcat