英文:
Tomcat7 not started on CentOS
问题
我已在CentOS上安装了Tomcat 7。我已经下载了tar文件并解压缩了它。然后我从bin文件夹启动了它,在命令行中显示Tomcat已启动。然后我尝试通过localhost:8080访问,但什么都没有显示。
我还尝试通过创建setenv.sh文件并在其中写入JRE_HOME来解决。
我还无法停止Tomcat。收到以下消息:
[root@localhost bin]# ./shutdown.sh
Using CATALINA_BASE: /opt/apache-tomcat-7.0.69
Using CATALINA_HOME: /opt/apache-tomcat-7.0.69
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.69/temp
Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java
Using CLASSPATH: /opt/apache-tomcat-7.0.69/bin/bootstrap.jar:/opt/apache-tomcat-7.0.69/bin/tomcat-juli.jar
/opt/apache-tomcat-7.0.69/bin/catalina.sh: 第448行:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java:不是目录
[root@localhost bin]#
这是来自catalina_out日志文件的内容:
[root@localhost apache-tomcat-7.0.69]# cd logs/
[root@localhost logs]# cat catalina.out
/opt/apache-tomcat-7.0.69/bin/catalina.sh: 第396行:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java:不是目录
./catalina.sh: 第396行:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java:不是目录
/opt/apache-tomcat-7.0.69/bin/catalina.sh: 第396行:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java:不是目录
/opt/apache-tomcat-7.0.69/bin/catalina.sh: 第396行:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java:不是目录
/opt/apache-tomcat-7.0.69/bin/catalina.sh: 第396行:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java:不是目录
[root@localhost logs]#
我还检查了端口列表,目前没有其他应用程序在使用该端口。
我一直在收到这些错误消息,陷入了这个问题中。
英文:
I have installed Tomcat7 on CentOS. I have downloaded the tar file and unzipped it. Then from bin folder i have started it and in the command line is it showing Tomcat has started. Then i am trying to get in via localhost:8080
But nothing is showing.
I have also tried by creating setenv.sh file and write the JRE_HOME there.
I am also unable to stop the tomcat. Getting following message
[root@localhost bin]# ./shutdown.sh
Using CATALINA_BASE: /opt/apache-tomcat-7.0.69
Using CATALINA_HOME: /opt/apache-tomcat-7.0.69
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.69/temp
Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java
Using CLASSPATH: /opt/apache-tomcat-7.0.69/bin/bootstrap.jar:/opt/apache-tomcat-7.0.69/bin/tomcat-juli.jar
/opt/apache-tomcat-7.0.69/bin/catalina.sh: line 448: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java: Not a directory
[root@localhost bin]#
Here is the log file from catalina_out
[root@localhost apache-tomcat-7.0.69]# cd logs/
[root@localhost logs]# cat catalina.out
/opt/apache-tomcat-7.0.69/bin/catalina.sh: line 396: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java: Not a directory
./catalina.sh: line 396: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java: Not a directory
/opt/apache-tomcat-7.0.69/bin/catalina.sh: line 396: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java: Not a directory
/opt/apache-tomcat-7.0.69/bin/catalina.sh: line 396: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java: Not a directory
/opt/apache-tomcat-7.0.69/bin/catalina.sh: line 396: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java/bin/java: Not a directory
[root@localhost logs]#
I have also checked the port list, no other application is using it now.
I am getting these error messages all the time and stuck on this issue.
答案1
得分: 1
你的 JRE_HOME
必须是 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre
。
英文:
Your JRE_HOME
must be /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论