简体   繁体   English

catalina.out中有很多(Permission denied)

[英]a lots of (Permission denied) in catalina.out

How can i install Apache web server and Apache tomcat to avoid get errors like this: 如何安装Apache Web服务器和Apache tomcat以避免出现如下错误:

java.io.FileNotFoundException: /usr/local/apache-tomcat-7.0.5/work/Catalina/localhost/_/SESSIONS.ser (Permission denied)

in /usr/local/apache-tomcat-7.0.5/logs/catalina.out 在/usr/local/apache-tomcat-7.0.5/logs/catalina.out中

I think I should do something for Apache user, because when I chmod 777 -R ./ on tomcat folder all errors disappear. 我想我应该为Apache用户做点什么,因为当我在tomcat文件夹上chmod 777 -R ./ ,所有错误都会消失。

$ chmod -R 777 webapps temp logs work conf

Is VERY dangerous, do not do it, did I write "not do it" ? 非常危险,不要这样做,我写“不做”吗? DO NOT DO IT! 不要做! Guess where your tomcat-users.xml is with your usernames and plain-text passwords ? 猜猜你的tomcat-users.xml在哪里用你的用户名和纯文本密码?

Giving world read-write-execute anywhere on UNIX except /tmp (and even then, in prod, NEVER do that either) is plain stupid. 在UNIX上的任何地方给予世界读写执行,除了/ tmp(甚至那时,在生产中,从来没有这样做)是非常愚蠢的。 And, it makes your first line, chown -R tomcat6 completely useless. 并且,它使你的第一行,chown -R tomcat6完全没用。

make sure tomcat runs as tomcat7 (it is tomcat6 for tomcat 6) and simply do: 确保tomcat以tomcat7运行(对于tomcat 6来说是tomcat6)并简单地执行:

$ cd $TOMCAT_BASE
$ chown -R tomcat7:tomcat7 webapps temp logs work conf
$ chmod -R 660 webapps temp logs work conf

[EDIT] changed 770 to 660 following comment, because the files in question need not be executed. 注释后,[编辑]将770更改为660 ,因为无需执行相关文件。

If you want to be able to read, write, or execute stuff there, add yourself to the tomcat7 group. 如果您希望能够在那里读取,写入或执行某些内容,请将自己添加到tomcat7组。

Can't vouch for the security of doing so, but 不能担保这样做的安全性,但是

$ cd /usr/local/tomcat/ #or /usr/shared/tomcat6, whatever your $TOMCAT_BASE dir
$ chown -R tomcat6 webapps temp logs work conf
$ chmod -R 777 webapps temp logs work conf

works a treat for these situations. 工程请客针对这些情况。

My tomcat install was borked with permission errors, but throwing open the gates thusly fixed everything. 我的tomcat安装被许可错误所困扰,但是打开大门因此修复了一切。

Ran into a similar situation like this with an older Tomcat-6 implementation... 使用较旧的Tomcat-6实现进入类似的情况......

...
SEVERE: Error deploying web application directory host-manager
java.io.FileNotFoundException: /opt/tomcat-6/conf/Catalina/localhost/host-manager.xml (Permission denied)
...

And, the webapp XMLs were all there and the ownership and permissions were all "tomcat:tomcat" and "644". 并且,webapp XML都在那里,所有权和权限都是“tomcat:tomcat”和“644”。

For me, the solution was to set the overall permissions to what Tomcat prefers, namely "0755". 对我来说,解决方案是将总体权限设置为Tomcat喜欢的权限,即“0755”。

And, as a note for the security-conscious, the server.xml for that implementation is using a JDBC Realm for authentication, so we don't even use tomcat-users.xml. 并且,作为注意安全性的注释,该实现的server.xml使用JDBC Realm进行身份验证,因此我们甚至不使用tomcat-users.xml。 So, it is the default file that comes with the installation and even commented out the default user accounts within it (eg "tomcat" and "manager"). 因此,它是安装附带的默认文件,甚至注释掉其中的默认用户帐户(例如“tomcat”和“manager”)。 I know in Tomcat-7, the accounts in tomcat-users.xml are commented by default. 我知道在Tomcat-7中,tomcat-users.xml中的帐户默认被注释。

HTH. HTH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM