diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 5d5f5da24c3eb4d1f620ec1092c4ff8569445ca3..6c6d75ed8a8673e5f37e1cfb3d64268a8d38d577 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -23,6 +23,7 @@ ServerAdmin webmaster@ ErrorLog /var/log/ispconfig/httpd//error.log + ErrorDocument 400 /error/400.html diff --git a/server/cron_daily.php b/server/cron_daily.php index b861558f7190a2b1c2876ee657674861c5d84d69..dd32c4621c389a969d86d13b3d4134348b24197b 100644 --- a/server/cron_daily.php +++ b/server/cron_daily.php @@ -207,6 +207,13 @@ foreach($records as $rec) { exec("gzip -c $logfile > $logfile.gz"); unlink($logfile); } + + // rotate and compress the error.log when it exceeds a size of 10 MB + $logfile = escapeshellcmd($rec["document_root"].'/log/error.log'); + if(is_file($logfile) && filesize($logfile) > 10000000) { + exec("gzip -c $logfile > $logfile.1.gz"); + exec("cat /dev/null > $logfile"); + } // delete logfiles after 30 days $month_ago = date("Ymd",time() - 86400 * 30); @@ -216,6 +223,17 @@ foreach($records as $rec) { } } +####################################################################################################### +// Rotate the ispconfig.log file +####################################################################################################### + +// rotate the ispconfig.log when it exceeds a size of 10 MB +$logfile = '/var/log/ispconfig/ispconfig.log'); +if(is_file($logfile) && filesize($logfile) > 10000000) { + exec("gzip -c $logfile > $logfile.1.gz"); + exec("cat /dev/null > $logfile"); +} + ####################################################################################################### // Cleanup website tmp directories #######################################################################################################