I'm hosting multiple apache virtual hosts, with similar structure:
- /var/www/
- domain
- documentroot
- logs
I've thus modified rule in logrotate.d/apache2
to start with
/var/log/apache2/*.log /var/www/*/logs/*.log { ... rule details ... }
Now the problem, logrotate doesn't allow me to rotate the folders, because they are owned by user and group according to virtual hosting (group has usually multiple users, one user equals one virtual host)
Error message is
error: skipping "/var/www/default/logs/access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
How can I configure logrotate to use user and group from parent folder?
VirtualHosts are ran under MPM-ITK module to separate permissions for underlying apache/php-cgi processes.
Is it possible to avoid creating configuration rule for each virtualhost separately?