I have a server (Leopard Server, not my choice) running Apache and MySQL. Several months ago, the server began to raise "Forbidden" errors at random intervals, preventing access to a PHP application. This behavior randomly ceased.
Now, several days ago I installed Passenger and deployed a Sintra/Rack application. The application runs as a user acarneg
(for example) from /Library/WebServer/Documents/presto/current/public
, acarneg
owns the entire structure. The _www
user has access to the directory via ACL chmod +a "_www allow read,write,..."
.
Everything works great! But after a randomish interval, often ~12 or ~24 hours, Passenger throws an error that also prevents the PHP application from running. Passenger Error #2. Cannot stat file config.ru. Permission denied.
But the permissions haven't changed (confirmed) and all one has to do to resolve the error is sudo apachectl graceful
.
If the permissions aren't changing and Apache doesn't seem to have a legit problem, what is causing this mess? Why did it stop before, and why has it resumed!?!?!?
Thanks for the help!
Your Apache is probably reaching the maximum open files limit. Apache will cause permission errors and it also explains why it takes a while and is resolved by reloading Apache.
I'm not really familiarly with Mac's but there should be a command to check the open files of a process. (eg. lsof, pfiles, procfiles).
Possible resolutions are:
See also File Descriptor Limit in the Apache documentation.
Where is the filesystem storage? Does it require kerberos to access the data, or AFS or something else, so that your problem is an expiring ticket?