无法访问生产中的日志文件 [英] Can't access log files in production
问题描述
我试图运行我的应用程序,并在production.log上检查一些输出.但是 Ruby on Rails 会引发此错误. Apache日志
I was trying to run my application and check for some output on the production.log. However Ruby on Rails throws this error. Apache log
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访问权限.
I have performed the necessary chmod 666 production.log to make it work but I realized that the file is under root access.
所以我的文件权限是
-rw-rw-rw- 1 root root 20845 2010-03-18 01:18 production.log
我不确定如何允许Ruby on Rails访问此文件.我刚开始管理Linux生产环境,所以请您原谅我的无知.
I'm not sure how to allow Ruby on Rails to access this file. I'm fairly new to managing a Linux production environment so I request you to excuse my ignorance.
推荐答案
我认为您需要将用户和production.log组更改为在以下用户和组Rails下运行的任何用户和组: .
I think you need to change the user and group of production.log to whatever user and group Rails (i.e. Passenger or Mongrel or whatever you are using) runs under.
这篇关于无法访问生产中的日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!