Author Topic: logrotate  (Read 8499 times)

0 Members and 1 Guest are viewing this topic.

Offline
***
logrotate
« on: May 19, 2017, 10:48:15 AM »
How do I enable logrotate?

Offline
***
Re: logrotate
« Reply #1 on: May 19, 2017, 07:30:01 PM »
Would this work  0 0 1 * * /etc/cron.daily/logrotate

Offline
***
Re: logrotate
« Reply #2 on: May 19, 2017, 10:31:30 PM »
Or this one

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

Offline
*
Re: logrotate
« Reply #3 on: May 24, 2017, 11:32:53 AM »
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
Code: [Select]
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:
Code: [Select]
/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
}