Hi to all, this is an incredible story: my customer's web site (with wordpress inside) had a php internal error (caused by a plugin)... for this reason, the linux operative system had created many error log file of 40 GB, wasting all file system space.... as you know the directory /var/www/clients/client0/web1/log is created by root and the file owner is root so for this reason, the quota setting for the user web1 is not valid... Does anybody know how to avoid this problem in the future? PS: I believe that this problem is very serious and should be addressed in the guides that talk about how to install ispconfig
The log directory is not /var/www/clients/client0/web1/log. /var/www/clients/client0/web1/log is just a mount point for asier access to the logs in /var/log/httpd/.... So all log files are in /var/log and its subdirectories, e.g. the access and error logs of the webstes are in /var/log/httpd/domain.tld/ So you can prevent that issue by creating a separate partition for log files on your harddisk.
Suppose that it is not possibile (for now, I can't reinstall my production server), I have found another solution : For Debian: http://blog.netflowdevelopments.com...rom-getting-out-of-control-in-debian-squeeze/ For Centos: http://stackoverflow.com/questions/...g-logrotate-to-maximum-file-size-for-all-logs What do you think about it? PS I reccomend to suggest it into your ISPCONFIG GUIDES
Thats what ispconfig is doing already in the 3.0.5.x releases. The log size is checked every night like logrotate is doing it in the guides you posted above and a new log file gets started when the first one gets too big and the old one gets compressed.
Thank you for your reply... you say that "the log size is checked every night"... for this reason in 13 hours "a 40 gb file" has been created after the midnight and I don't want that... (calculating 40gb/13hours=near 74 GB in 24 hours!) Calculating 10 web site with the same problem = 740 GB !! An hacker could infect some "cms plugin" to create this problem to logs files...
Logrotate, which you posted above, is also checking the filesize once every night. you can use some code from crob_daily.php in ispconfig and run it e.g. once every hour, if you like to have the files checked more often.
Hi till, looking into /etc/logrotate.d/apache2, can I modify the code so it compress the file when it reaches the 250MB size? Code: /var/log/apache2/*.log { size 250M weekly missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript prerotate if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ run-parts /etc/logrotate.d/httpd-prerotate; \ fi; \ endscript } Thank you for your reply.