# Rails Error: Unable to access log file... in Apache error lo

**URL:** <https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file-in-apache-error-lo/77192>\
**Category:** Rails\
**Created:** [November 25, 2006, 12:51am UTC](https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file-in-apache-error-lo/77192 "2006-11-25T00:51:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ccd318/32.png) [@Leng](https://www.ruby-forum.com/u/Leng)\
**Post date:** [November 25, 2006, 12:51am UTC](https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file-in-apache-error-lo/77192/1 "2006-11-25T00:51:44Z")

</div>

Hi,

My Rails Depot app is working fine using WEBrick server but with  
Apache2, the app is having problems with writing to the development.log  
file. When using WEBrick, the development.log shows the logging  
consistently, but when using Apache2, nothing shows in the  
development.log file. On checking the Apache error log, I get this:

[Sat Nov 25 10:24:38 2006] [error] [client 127.0.0.1] Rails Error:  
Unable to access log file. Please ensure that  
/srv/www/htdocs/depot/…/config/…/log/development.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.

I am a newbie to RoR and Linux as well (about 3 weeks). I have  
performed “chown, and chgrp and chmod” on the log directory and “ls -l  
/srv/www/rails/depot/log” produced the following:  
-rw-rw-rw- 1 wwwrun www 442996 2006-11-23 17:37 development.log  
-rw-rw-rw- 1 wwwrun www 0 2006-11-20 22:34 production.log  
-rw-rw-rw- 1 wwwrun www 0 2006-11-20 22:34 server.log  
-rw-rw-rw- 1 wwwrun www 0 2006-11-20 22:34 test.log

What am I missing here?

Cheers,  
Leng

---

<div class="post-metadata">

**Author:** ![Leng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ccd318/32.png) [@Leng](https://www.ruby-forum.com/u/Leng)\
**Post date:** [November 29, 2006, 9:04pm UTC](https://www.ruby-forum.com/t/rails-error-unable-to-access-log-file-in-apache-error-lo/77192/2 "2006-11-29T21:04:52Z")

</div>

Hi Leng, the webrick server may have an exclusive lock on the  
development.log file. Also, you cannot change the file’s permission to  
gain  
write access to a file that has a exclusive lock. My recommendation  
would  
be to allow Apache and Webrick to write to their own respective log  
files  
because it makes it easier to debug the application in question.

Good luck,

-Conrad
