hesco has asked for the wisdom of the Perl Monks concerning the following question:

Hello again:

Using Log::Log4perl, I'm getting errors in the browser looking like this:

There has been an error: Cannot write to '/var/log/apache-ssl/dpr.log' +: Permission denied at /usr/local/share/perl/5.8.7/Log/Dispatch/File. +pm line 86.
Although, when I su - www-data (my apache user), I am able to update the last modification date with the touch command and use vim to edit the log file, as well.

Can anyone here please advise why my log file would be inaccessible to this web application?

-- Hugh

UPDATE

Thanks to Mike Schilli (a responsive package maintainer who monitors and rapidly responds to his support list), I was reminded that the webuser also has need of write permissions on the directory above the log file as well. I moved my log to a directory created for this purpose in /tmp and things started working. I'm adding to my to-do list figuring out how to get these logs out of the /tmp directory without exposing other file heirarchies to the exposure of a webserver writing to them. But for the moment this has me moving on this project again. Thank you Mr. Schilli!

Replies are listed 'Best First'.
Re: Log::Log4perl write permissions
by swampyankee (Parson) on Feb 22, 2006 at 22:28 UTC

    Other than the obvious two possibilities (that the web application doesn't have permission to write to the file and that there is another process locking the file)?

    No.

    I do realize that most flavors of *ix use advisory, not strict, locking, but if you've got the kernel source, you can do anything

    emc

    " When in doubt, use brute force." — Ken Thompson