Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

up vote 5 down vote accepted
+100

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:

  • Increase the maximum open files (ulimit)
  • Reduce the number of log files
  • Check if the PHP code closes all it's files

See also File Descriptor Limit in the Apache documentation.

share|improve this answer
    
The PHP scripts should close any open files when it finishes. Using sessions (especially with a large timeout) will prolong this. But you should still try to find a way to monitor the (amount of) open files to make sure this is the problem. –  basvdlei May 6 '10 at 11:12
    
It actually seems that this is not the problem. PHP's only file handling operation seems to be move_uploaded_files –  arbales May 10 '10 at 22:46

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?

share|improve this answer
    
It's on the system volume, which, in this case is formatted HFS+ Journaled. There should be no interruption in service to the disk. –  arbales Apr 30 '10 at 3:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.