# Rails Error: Unable to access log file

**URL:** <https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file/144519>\
**Category:** Rails\
**Created:** [July 30, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file/144519 "2008-07-30T16:21:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file/144519/1 "2008-07-30T16:21:01Z")

</div>

I cannot get rails/passenger to write to my production log ☹

On my production server in the apache error\_log I get:

## – Rails Error: Unable to access log file. Please ensure that /my/app/ log/ production.log exists and is chmod 0666.

Doing the following using copy/paste to avoid path/typo confusion:

–

# ls -la

drw-rw-rw- 2 apache apache 4096 Jul 30 11:41 .  
drwxrwxr-x 14 apache apache 4096 Jul 30 11:41 …  
-rw-rw-rw- 1 apache apache 0 Jul 30 11:32 /my/app/log/production.log

# cat /my/app/log/production.log

# 

–

Passenger is set to run as user ‘apache’, as is apache/httpd itself.  
Relevant httpd.conf lines:

## – PassengerDefaultUser apache PassengerUserSwitching off

I also set the log level to 3 which didn’t seem to add anything  
relevant to this problem to the error\_log.

I’m running on CentOS 5 and SELinux is disabled:

–

# sestatus

## SELinux status: disabled

Looking at the processes, Passenger and Rails seem to be running as  
the correct user ‘apache’ as does httpd.

Can somoeone tell me where to look next please, I’m a bit lost now.

Cheers,

Kev

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 21, 2010, 2:12pm UTC](https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file/144519/2 "2010-02-21T14:12:27Z")

</div>

Hey Kev!

You ever find the solution to this issue?

Im running three rails apps on my server, all on the same version of  
rails.

One of them runs fine, the other two kick up this error when I try to  
start them.

Any clues would be helpful?

Thanks

Gav

removed\_email\_address@domain.invalid wrote:

> I cannot get rails/passenger to write to my production log ☹
> 
> On my production server in the apache error\_log I get:
> 
> ## – Rails Error: Unable to access log file. Please ensure that /my/app/ log/ production.log exists and is chmod 0666.
> 
> Doing the following using copy/paste to avoid path/typo confusion:
> 
> –
> 
> # ls -la
> 
> drw-rw-rw- 2 apache apache 4096 Jul 30 11:41 .  
> drwxrwxr-x 14 apache apache 4096 Jul 30 11:41 …  
> -rw-rw-rw- 1 apache apache 0 Jul 30 11:32 /my/app/log/production.log
> 
> # cat /my/app/log/production.log
> 
> # 
> 
> –
> 
> Passenger is set to run as user ‘apache’, as is apache/httpd itself.  
> Relevant httpd.conf lines:
> 
> ## – PassengerDefaultUser apache PassengerUserSwitching off
> 
> I also set the log level to 3 which didn’t seem to add anything  
> relevant to this problem to the error\_log.
> 
> I’m running on CentOS 5 and SELinux is disabled:
> 
> –
> 
> # sestatus
> 
> ## SELinux status: disabled
> 
> Looking at the processes, Passenger and Rails seem to be running as  
> the correct user ‘apache’ as does httpd.
> 
> Can somoeone tell me where to look next please, I’m a bit lost now.
> 
> Cheers,
> 
> Kev
