gpt4 book ai didi

tomcat - 安装Tomcat时如何修复不正确的权限?

转载 作者:行者123 更新时间:2023-11-28 23:44:17 24 4
gpt4 key购买 nike

我刚刚在 Ubuntu 13.04 中安装了 Tomcat 7,但我在启动服务器时遇到问题。

我已经通过命令安装了 Tomcat 7:

tar -xzpf ./apache-tomcat-7.0.26.tar.gz -C /chemin_vers_dossier_d_installation/

并启动服务器:

 /opt/apache-tomcat-7.0.39/bin/catalina.sh run

但是我有这个错误信息:

run
Using CATALINA_BASE: /opt/apache-tomcat-7.0.39
Using CATALINA_HOME: /opt/apache-tomcat-7.0.39
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.39/temp
Using JRE_HOME: /home/fakarovic/jdk1.6.0_45/
Using CLASSPATH: /opt/apache-tomcat-7.0.39/bin/bootstrap.jar:/opt/apache-tomcat-7.0.39/bin/tomcat-juli.jar
May 10, 2013 9:19:32 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/opt/apache-tomcat-7.0.39/conf/server.xml]
May 10, 2013 9:19:32 AM org.apache.catalina.startup.Catalina load
WARNING: Permissions incorrect, read permission is not allowed on the file.
May 10, 2013 9:19:32 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/opt/apache-tomcat-7.0.39/conf/server.xml]
May 10, 2013 9:19:32 AM org.apache.catalina.startup.Catalina load
WARNING: Permissions incorrect, read permission is not allowed on the file.
May 10, 2013 9:19:32 AM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.

注意:我已经定义了 JAVA_HOME 变量。

最佳答案

Tomcat加强了文件系统层面的安全要求,所以如果是从较早的版本升级,就会出现这个问题。

发件人:https://tomcat.apache.org/tomcat-7.0-doc/security-howto.html

File permissions should also be suitably restricted. Taking the Tomcat instances at the ASF as an example (where auto-deployment is disabled and web applications are deployed as exploded directories), the standard configuration is to have all Tomcat files owned by root with group Tomcat and whilst owner has read/write privileges, group only has read and world has no permissions.

意味着您必须限制其他 对tomcat 目录的访问权限。特别是 $TOMCAT_HOME/conf.这就是您收到错误的原因,因为 Tomcat 启动所需的最低访问权限更多。

长话短说,将 Tomcat 目录访问限制为仅运行该进程的用户。

The exceptions are the logs, temp and work directory that are owned by the Tomcat user rather than root.

关于tomcat - 安装Tomcat时如何修复不正确的权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16478014/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com