Log Rotate

 Configure Log Rotate

You may also want to configure the logrotate so your log is turned over often enough to be effective. You can find the config file at /etc/logrotate.d/apache2 and you are interested in the access_log section. Mine was set to rotate based on size. I commented that out and specified daily. Below is the relevant section. Notice the * in front of access_log. This handles vhost logfiles that match the patter hostname-access_log as opposed to just access_log.

/var/log/apache2/*access_log {
    compress 
    dateext 
    maxage 365 
    rotate 99 
   #size=+4096k 
    daily 
    notifempty 
    missingok 
    create 644 root root 
    postrotate 
        /etc/init.d/apache2 reload endscript 
}
Comments