2010-03-18 120 views
0

我试图运行我的应用程序,并检查production.log上的某些输出。但是Ruby on Rails会引发此错误。 Apache日志无法访问生产日志文件

Rails Error: Unable to access log file. Please ensure that /var/www/somefolder/someapp/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

我已经完成了必要的搭配chmod 666 production.log让它工作,但我意识到,该文件是在root权限。

所以我的文件权限

-rw-rw-rw- 1 root root 20845 2010-03-18 01:18 production.log

我不知道如何让Ruby on Rails的访问此文件。我对管理Linux生产环境相当陌生,所以我请求你原谅我的无知。

+0

我需要找到我的production.log文件....不知道在哪里看。 – 2013-11-02 01:18:17

回答

2

我认为您需要将production.log的用户和组更改为任何用户和组Rails(即Passenger或Mongrel或您正在使用的任何组件)。

2

好吧我只是想通了。

首先需要更新的apache.conf乘客配置:

PassengerDefaultUser username

的分配所有权使用CHOWN:

chown -R username:username <folder>

我不知道这是正确的方式,但它为我工作。