I have a problem with file permissions which is driving me crazy. I have a Perl web app which installs itself, copying some files, creating DB, and so on. All works fine, except for some image files. These images aren't accesible by Apache:
(13) Permission denied: access to /path/to/image.gif denied
But, the file es 644. I've tried chmod 777, and chown to Apache user, without positive results.
And what drives me crazy: if I copy the file, then rename old file and rename new file, it works!
mv image.gif image.gif.bak
cp image.gif.bak image.gif
Files are identical, same size, same permissions, same owner and group. I can see both in a imageviewer. But, if I restore original file (remove the "new" file and rename the "old" file to its original name) I got a "permission denied" again:
rm image.gif
mv image.gif.bak image.gif
This issue occurs with all image files, but not with text files (static html, css...).
What could be causing this strange behavior?
I'm using Apache 2.2.3 under CentOs 5.5. Perl scripts (Perl 5.8.8) runs with Suexec.