Sunday, February 3, 2019

apache 2.2 - Preventing error_log flooding



Is there a way to have httpd/php stop logging errors if they are repeating over and over again to prevent flooding?




Currently the /usr/local/apache/logs/error_log file is getting flooded and would like to prevent that.


Answer



To piggy back what Michael said, I'd setup individual logging for each vhost.



This is a simple configuration change and should save you lots of headaches down the road.. Simply add an ErrorLog entry in each entry. This also helps limit confusion for development and troubleshooting.



Once the individual logging has been enabled, your next step should be to setup log rotation on each of those directories/logs using logrotate.



Lastly, you could also configure/implement user quotas for those vhosts/users/homedirs and prevent their logs from eating all of the system's available hard disk.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...