[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: logrotate and apache virtual domains



On Tue Dec 30, 2008 at 12:18:35 -0500, Rick Pasotto wrote:
> I have several domains with their log files in separate directories
> under /var/log/apache2. Logrotate is rotating only files in
> /var/log/apache2 and not in the subdirectories.
>
> Where/how do I get logrotate to rotate the virtual host logs?

  Update /etc/logrotate.d/apache2 to include the appropriate
 files.  Part of mine, for example, is this:

/home/www/*/logs/*.log {
        daily
        missingok
        rotate 5
        compress
        delaycompress
        notifempty
        create 644 root root
        sharedscripts
        prerotate
                /usr/bin/vh-update-stats > /dev/null
        endscript
        postrotate
                /etc/init.d/apache2 restart > /dev/null
        endscript
}

>
  I store sites as:

    /home/www/foo.com/{ logs cgi-bin htdocs }
    /home/www/bar.com/{ logs cgi-bin htdocs }

Steve
-- 
Managed Anti-Spam Service
http://mail-scanning.com/


Reply to: