diff --git a/createlinks b/createlinks index 3ee8ff5..cc62c67 100644 --- a/createlinks +++ b/createlinks @@ -2,7 +2,7 @@ use esmith::Build::CreateLinks qw(:all); -templates2events("/etc/cron.hourly/awstats", qw(webapps-update bootstrap-console-save domain-create domain-modify domain-delete)); +templates2events("/usr/share/awstats/wwwroot/index.html", qw(webapps-update bootstrap-console-save domain-create domain-modify domain-delete)); foreach my $event (qw/webapps-update bootstrap-console-save domain-create domain-modify domain-delete/){ event_link("awstats-update", "$event", "80"); diff --git a/ipasserelle-stats.spec b/ipasserelle-stats.spec index a4c8f7e..cd88d4d 100644 --- a/ipasserelle-stats.spec +++ b/ipasserelle-stats.spec @@ -1,5 +1,5 @@ -%define version 0.1.0 -%define release 1 +%define version 0.1.1 +%define release 1.beta0 %define name ipasserelle-stats @@ -31,14 +31,12 @@ Génère des statistique de consultation de vos sites web %build perl createlinks -%{__mkdir_p} root/home/e-smith/files/stats/ %install /bin/rm -rf $RPM_BUILD_ROOT (cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) /bin/rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ - --dir /home/e-smith/files/stats/ 'attr(0750,root,www)' \ > %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist diff --git a/root/etc/e-smith/events/actions/awstats-init-domain b/root/etc/e-smith/events/actions/awstats-init-domain index 7804c9e..faf05ef 100644 --- a/root/etc/e-smith/events/actions/awstats-init-domain +++ b/root/etc/e-smith/events/actions/awstats-init-domain @@ -38,7 +38,7 @@ if (!$vhost){ Description => "Statistiques web", Nameservers => 'internet', TemplatePath => 'WebAppVirtualHost', - DocumentRoot => '/home/e-smith/files/stats', + DocumentRoot => '/usr/share/awstats/wwwroot', LemonLDAP => 'enabled', Removable => 'yes', }); diff --git a/root/etc/e-smith/templates/etc/cron.hourly/awstats/10All b/root/etc/e-smith/templates/etc/cron.hourly/awstats/10All deleted file mode 100644 index c98f6f4..0000000 --- a/root/etc/e-smith/templates/etc/cron.hourly/awstats/10All +++ /dev/null @@ -1,14 +0,0 @@ -{ -use esmith::DomainsDB; -my $d = esmith::DomainsDB->open_ro or die "Couldn't open DomainsDB\n"; -my $lang = $awstats{'Language'} || 'fr'; -$OUT .= 'YEAR=$(date +%Y)'."\n"; - -foreach my $dom ($d->domains){ - my $stats = $dom->prop('Stats') || 'disabled'; - next if ($stats ne 'enabled'); - my $name = $dom->key; - $OUT .= 'mkdir -p /home/e-smith/files/stats/'."$name".'/$YEAR/'."\n"; - $OUT .= "/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=$name -update -lang=$lang -dir=/home/e-smith/files/stats/$name/\$YEAR/ 2>&1 > /dev/null\n\n"; -} -} diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98awstats b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98awstats index 62d6259..c0eb88f 100644 --- a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98awstats +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98awstats @@ -24,40 +24,13 @@ Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/" Allow from $allow - Deny from all + Options +ExecCGI + SetHandler cgi-script SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins - - Options None - Options +Indexes - Order deny,allow - Deny from all - Allow from $allow - SSLRequireSSL on - - EOF - - foreach my $dom ($d->domains){ - my $stats = $dom->prop('Stats') || 'disabled'; - next unless ($stats eq 'enabled'); - my $name = $dom->key; - my @users = split /[;,]/, ($dom->prop('StatsUsers') || ''); - foreach my $u (@users){ - $OUT .= " SetEnvIf Auth-User \"$u\" allow_$name\n"; - } - my $allowfromenv = (scalar @users > 0) ? "allow from env=allow_$name":''; - $OUT .=<<"HERE"; - - - DirectoryIndex awstats.$name.html - $allowfromenv - - -HERE - } } }