3

I'm deploy my app with capistrano on centos (apache + passenger), when access my web I got `HTTP 500 (Internal Server Error)' and check error_log file , here's error look likes :

DAV/2 Phusion_Passenger/3.0.19 mod_ssl/2.2.24 OpenSSL/1.0.0-fips configured -- resuming normal operations
Rails Error: Unable to access log file. Please ensure that /home/admin/myaap/releases/20130506191509/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..

production.log permission

-rwxrwxr-x 1 root root 46211 May 6 20:49 production.log

and

ActionView::Template::Error (Permission denied - /home/admin/myaap/releases/20130506191509/tmp/cache/assets/D3B

directory D3B not found.

I am looking for a solution via google, one of which is sudo chown -R root:root /home/admin/myapp/ but not working for me, Is there any other way to fix it?

Note :

I'm using user root for deploy and installing rvm, and directory root location on user 'admin' (kloxo control panel)

UPDATE

On error_log file not found error about permission and unable to access, I'm using chmod go-w /home/admin/myapp and chmod 0666 production.log , but my web still 500 server error, How do I check error?

rails_id
  • 8,120
  • 4
  • 46
  • 84
  • I got my tmp folder like this `drwxrwxr-x 3 ubuntu ubuntu` (permissions, user, group) and is working, maybe you can guide from these permissions. – sites May 07 '13 at 02:52

3 Answers3

4

As Rails is suggesting in the error log, you should change permissions for the log file to 066:

chmod 0666 production.log

You are using root to deploy, but the web server is using another user name.

David Morales
  • 17,816
  • 12
  • 77
  • 105
1

You need to make your apache user the owner of your app like:

sudo chown -R apacheuser:apacheuser /home/admin/myapp/
Fernando Diaz Garrido
  • 3,995
  • 19
  • 22
0

I've always had success with the the log file permissions as 644. When this has happened to me, more than once I might add, it has always been answered by the question linked below. Since this is the first answer in Google for the query I use, I'm linking to the answer that I really want.

Rails: Unable to access log file

Community
  • 1
  • 1
J Edward Ellis
  • 1,368
  • 2
  • 12
  • 21