不能访问生产日志文件
-
20-09-2019 - |
题
我试图运行我的应用程序,并检查在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,使其工作,但我意识到,该文件是在根目录访问。
所以,我的文件权限
-rw-rw-rw- 1 root root 20845 2010-03-18 01:18 production.log
我不知道如何让Ruby on Rails的访问此文件。我是相当新的管理Linux的生产环境,所以我要求您原谅我的无知。
解决方案
我想你需要production.log的用户和组改变到任何用户和组滑轨(即乘客或杂种或任何你正在使用)下运行。
其他提示
好,我刚计算出来。
首先需要更新的apache.conf乘客配置:
PassengerDefaultUser username
在分配所有权使用CHOWN:
chown -R username:username <folder>
我不知道这是正确的方式,但它为我工作。
不隶属于 StackOverflow