Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon May 11, 2015 7:28 pm 
Offline
Senior Member

Joined: Thu Apr 12, 2012 6:45 am
Posts: 60
Website: http://anderssonweb.se
Location: Puerto Galera, Philippines
Hi!

Having problem on one of my boxes with logrotate. Here's the scenario:

1) The box hosts multiple websites, all in /var/www and the structure is the same on all sites:
Code:
/var/www/domain/public_html
/var/www/domain/logs


access.log and error.log is site specific and saved in each logs-directory. Now I'm also having a folder for each site:
Code:
/var/www/domain/public_html/admin/logs


In the latter I keep log files for outgoing emails from each site, as well as logs from the payment providers etc. Here's the problem, my logrotation script:
Code:
/var/www/*/logs/*.log {
   weekly
   missingok
   rotate 7
   compress
   delaycompress
   notifempty
   create 640 root adm
   sharedscripts
   postrotate
     /etc/init.d/apache2 reload > /dev/null
   endscript
}

/var/www/*/public_html/admin/logs/*.log {
   weekly
   missingok
   rotate 7
   compress
   delaycompress
   notifempty
   create 775 kansliet_master www-data
   sharedscripts
   postrotate
     /etc/init.d/apache2 reload > /dev/null
   endscript
}


The thing is that on one of the servers (there are two in the environment with the same configuration hosting different sites) everything is working okay. But on the other one, on some sites, the log files in /var/www/*/public_html/admin/logs/ are rotated by the snippet for /var/www/*/logs/*.log and my guess is the * in the paths, which will match both directories. As you see the only difference is the owner of the files rotated and right now the files in /var/www/domain/public_html/admin/logs is getting root adm as owner group and the web server cannot write to these files anymore, which made that alla log files are empty and the site is throwing a permissios error.

How to I change the upper most snippet only to match access.log and error.log in each /var/www/domain/logs folder?

Thanks!


Top
   
PostPosted: Tue May 12, 2015 4:28 pm 
Offline
Senior Member

Joined: Fri Feb 13, 2015 8:12 pm
Posts: 101
Code:
/var/www/*/logs/access.log
/var/www/*/logs/error.log
{
   weekly
   [...]
}


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group