New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

logrotate

Started by pixelpadre, May 19, 2017, 10:48:15 AM

Previous topic - Next topic

pixelpadre

How do I enable logrotate?

pixelpadre

Would this work  0 0 1 * * /etc/cron.daily/logrotate

pixelpadre

Or this one

0 0 1 * * /usr/sbin/logrotate /etc/cron.daily/logrotate

IgorA100

I understand that initially the rotation of logs is not configured at all :(
I realized at myself as follows:
1. All logs are stored in the site directory.
Example:
/home/USER/www/vhosts/SITE/httpdocs- for site
/home/USER/www/vhosts/SITE/logs - for logs
Edit file /usr/local/apache/conf.d/vhosts.conf and add
ErrorLog "/home/USER/www/vhosts/SITE/logs/http_error.log"
CustomLog /home/USER/www/vhosts/SITE/logs/http_access.log combined

to the configuration of each virtual host. Then create the files http_error.log & http_access.log
2. In dir /etc/logrotate.d create file httpd with content:
/home/*/www/vhosts/*/logs/http_access.log /home/*/www/vhosts/*/logs/http_error.log /usr/local/apache/logs/access_log /usr/local/apache/logs/error_log /usr/local/apache/logs/suphp_log{
        maxsize 50000k
        notifempty
weekly
        rotate 8
        missingok
}