Index: modules/statsmaster/manifests/awstats.pp |
=================================================================== |
--- a/modules/statsmaster/manifests/awstats.pp |
+++ b/modules/statsmaster/manifests/awstats.pp |
@@ -1,12 +1,14 @@ |
class statsmaster::awstats { |
package {['awstats', 'libgeo-ip-perl']:} |
- file {['/var/www/awstatsdata', '/var/www/awstatsconf', '/var/www/awstats']: |
+ file {['/var/www/awstatsdata', '/var/www/awstatsdatadaily', |
+ '/var/www/awstatsconf', '/var/www/awstats', |
+ '/var/www/awstats/archive', '/var/www/awstats/daily']: |
ensure => directory, |
owner => root, |
mode => 0755, |
} |
file {'/etc/cron.d/awstats': |
# AWStats package thinks that running AWStats without proper configuration |
# every 10 minutes is a good idea. |
@@ -57,18 +59,19 @@ class statsmaster::awstats { |
define siteconfig($host, $log) { |
file {"/var/www/awstatsconf/awstats.$title.conf": |
ensure => present, |
mode => 0444, |
owner => root, |
content => template('statsmaster/awstats.conf'), |
} |
- file {["/var/www/awstatsdata/$title", "/var/www/awstats/$title", |
- "/var/www/awstats/archive/$title"]: |
+ file {["/var/www/awstatsdata/$title", "/var/www/awstatsdatadaily/$title", |
+ "/var/www/awstats/$title", "/var/www/awstats/archive/$title", |
+ "/var/www/awstats/daily/$title"]: |
ensure => directory, |
mode => 0755, |
owner => stats, |
} |
concat::fragment {"index_$title": |
target => '/var/www/awstats/index.html', |
content => template('statsmaster/index_item.html.erb'), |
@@ -126,36 +129,46 @@ class statsmaster::awstats { |
'intraforum.adblockplus.org' => { |
host => 'server_10.adblockplus.org', |
log => 'access_log_intraforum', |
}, |
} |
create_resources(statsmaster::awstats::siteconfig, $sites) |
+ # |
+ # IMPORTANT: This will only work correctly if the following bugs are fixed |
+ # in your AWStats instance (might require manual patching): |
+ # |
+ # * https://sourceforge.net/p/awstats/bugs/873/ |
+ # * https://sourceforge.net/p/awstats/bugs/929/ |
+ # |
+ |
cron {'awstats_update': |
ensure => present, |
require => [ |
Package['awstats', 'libgeo-ip-perl'], |
File['/home/stats/process_logs', '/home/stats/build_static', |
- '/var/www/awstatsconf', '/var/www/awstatsdata', '/var/www/awstats'], |
+ '/var/www/awstatsdata', '/var/www/awstatsdatadaily', |
+ '/var/www/awstats', '/var/www/awstatsconf'], |
], |
command => '/home/stats/process_logs && /home/stats/build_static', |
environment => ['MAILTO=admins@adblockplus.org,root'], |
user => stats, |
hour => 4, |
minute => 0, |
} |
cron {'awstats_prevmonth': |
ensure => present, |
require => [ |
Package['awstats'], |
File['/home/stats/build_static', '/home/stats/anonymize_ips', |
- '/var/www/awstatsconf', '/var/www/awstatsdata', '/var/www/awstats'], |
+ '/var/www/awstatsdata', '/var/www/awstatsdatadaily', |
+ '/var/www/awstatsconf', '/var/www/awstats'], |
], |
command => '/home/stats/anonymize_ips prevmonth && /home/stats/build_static prevmonth', |
environment => ['MAILTO=admins@adblockplus.org,root'], |
user => stats, |
monthday => 1, |
hour => 6, |
minute => 0, |
} |