无法启动 tomcat

无法启动 tomcat

我尝试在我的 Ubuntu 18 上安装 Tomcat-8,并进行了所有基本配置,包括 JAVA 设置、环境变量、文件/文件夹权限和服务文件的创建。但是当我尝试运行 Tomcat 时,它出现错误并终止。从日志或“journalctl -xe”简要详细信息如下:

-- Subject: Unit tomcat.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit tomcat.service has begun starting up.
Jul 04 00:59:01 myserver startup.sh[3626]: Existing PID file found during start.
Jul 04 00:59:01 myserver startup.sh[3626]: Removing/clearing stale PID file.
Jul 04 00:59:01 myserver startup.sh[3626]: Tomcat started.
Jul 04 00:59:01 myserver shutdown.sh[3647]: PID file found but either no matching process was found or the current user does not have permission t
Jul 04 00:59:01 myserver systemd[1]: **tomcat.service: Control process exited, code=exited status=1**
Jul 04 00:59:01 myserver systemd[1]: **tomcat.service: Failed with result 'exit-code'.**
Jul 04 00:59:01 myserver systemd[1]: **Failed to start Tomcat 8 servlet container.**
-- Subject: Unit tomcat.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit tomcat.service has failed.
--
-- The result is RESULT.
Jul 04 00:59:01 myserver systemd[1]: tomcat.service: Service hold-off time over, scheduling restart.
Jul 04 00:59:01 myserver systemd[1]: tomcat.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit tomcat.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jul 04 00:59:01 myserver systemd[1]: Stopped Tomcat 8 servlet container.
-- Subject: Unit tomcat.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit tomcat.service has finished shutting down.
Jul 04 00:59:01 myserver systemd[1]: **tomcat.service: Start request repeated too quickly.**
Jul 04 00:59:01 myserver systemd[1]: **tomcat.service: Failed with result 'exit-code'.**
Jul 04 00:59:01 myserver systemd[1]: **Failed to start Tomcat 8 servlet container.**
-- Subject: Unit tomcat.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit tomcat.service has failed.
--
-- The result is RESULT.

有人可以指导我做错了什么吗?

问候,

答案1

似乎用于启动 Tomcat 服务器的用户没有权限删除/修改 PID 文件(该文件包含正在运行的服务器实例的进程 ID)。您可能最初以 root 身份启动 Tomcat,Tomcat 因其他原因(留下 root 拥有的旧 PID 文件)不正常关闭,但随后切换到另一个用户(该用户无法删除/修改 root 拥有的文件)。您可能需要成为 root 并将 PID 文件的所有权更正为将运行 Tomcat 的用户,或者只是以 root 身份删除旧 PID 文件。

相关内容