Apache2 error.log problem
I'm running a small hosting-server and i'm having a problem. I'm running Debian Lenny; apache2, php5, mysql etc. The usual stuffs.
I have something like 20 virtualhosts on apache. I have disabled the error messages in php.ini so errors don't show up in the browser. All PHP error messages goes to users homedir ~/logs/error.log. Users have read-only access to their ~/logs directory and their error.logs file. Logrotate is rotating the logs. Everything is running smoothly.
One user is building/testing a new site of his. He's getting a lot of error messages, and he's debugging a lot. Every now and then something wierd is happening. The user makes something or some PHP-script/software what he's using is not working which causes a PHP error. The error-message goes to error.log as usual but apache/PHP repeats the error-message like million times until the error.log fills all my available harddrive.
This causes the bigger problems. My harddrive is filled up which of course causes many other problems. Mysql won't accept new connections etc. The main problem is that one user and his error.log can fill up all my harddrive.
I have no idea why some PHP-code/script repeats the error-message a million times. To be honest i don't want to know but i want to prevent this happening again. I don't mind if one error.log is huge, i can always clean it up but if it causes system-wide problems then it's a major problem.
All my users have a quota setup. They have 100Mb to 500Mb quota. The error.log is in ~/logs directory but the owner is not the user himself.
What can i do? What changes should i do? I hope there's some easy sollution and i just can't see it atm :)
btw. Thanks for the great site and awesome forums!
I guess you're using mod_php at the moment, and therefore the logs are owned by the Apache user?
You could use suPHP or FastCGI - in these cases you can make PHP run as the web site owner, and the error log would also belong to that user and therefore fall under that user's quota.
Yes, i'm using mod_php. And yes, this would solve my problem.
What happens if the user owns the error.log file and he deletes that file for some reason? How would apache handle that?
At the moment users don't own their error.log files, so they cannot delete those files.
I have to think about this and i'm gonna test it. Thanks mate.
|All times are GMT +2. The time now is 09:11.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.