From 7b08e7f1dcf64db5d7d4408ede41417d0eb5a747 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Nov 16 2012 16:02:39 +0000 Subject: fix configuration for httpd 2.4 (#871366) --- diff --git a/awstats-7.0-httpd-2.4.patch b/awstats-7.0-httpd-2.4.patch new file mode 100644 index 0000000..2fe23b6 --- /dev/null +++ b/awstats-7.0-httpd-2.4.patch @@ -0,0 +1,45 @@ +diff -up awstats-7.0/tools/httpd_conf.http-2.4 awstats-7.0/tools/httpd_conf +--- awstats-7.0/tools/httpd_conf.http-2.4 2012-11-16 16:11:07.612386681 +0100 ++++ awstats-7.0/tools/httpd_conf 2012-11-16 16:44:24.921755562 +0100 +@@ -10,20 +10,33 @@ + + # + # Directives to add to your Apache conf file to allow use of AWStats as a CGI. +-# Note that path "/usr/local/awstats/" must reflect your AWStats install path. ++# Note that path "/usr/share/awstats/" must reflect your AWStats install path. + # +-Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/" +-Alias /awstatscss "/usr/local/awstats/wwwroot/css/" +-Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/" +-ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/" ++Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/" ++Alias /awstatscss "/usr/share/awstats/wwwroot/css/" ++Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/" ++ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/" + + + # + # This is to permit URL access to scripts/files in AWStats directory. + # +- ++ + Options None + AllowOverride None +- Order allow,deny +- Allow from all ++ ++ # Apache 2.4 ++ Require local ++ ++ ++ # Apache 2.2 ++ Order allow,deny ++ Allow from 127.0.0.1 ++ Allow from ::1 ++ + ++# Additional Perl modules ++ ++ SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins ++ ++ diff --git a/awstats.spec b/awstats.spec index 0682a82..00c4fce 100644 --- a/awstats.spec +++ b/awstats.spec @@ -11,6 +11,8 @@ Patch1: awstats-awredir.pl-sanitize-parameters.patch Patch2: awstats-perl-5.14.patch # CVE-2012-4547, #871159 Patch3: awstats-7.0-cleanxss.patch +# fix configuration for httpd 2.4 (#871366) +Patch4: awstats-7.0-httpd-2.4.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -46,6 +48,8 @@ http://localhost/awstats/awstats.pl %patch1 -p 1 %patch2 -p 1 %patch3 -p 1 -b .cleanxss +%patch4 -p 1 -b .httpd-2.4 + # Fix style sheets. perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/* # Fix some bad file permissions here for convenience. @@ -106,16 +110,17 @@ install -p -m 644 $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/%{name}.{model,localhos # Fix scripts perl -pi -e 's|/usr/local/awstats|%{_datadir}/awstats|g' \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/tools/{*.pl,httpd_conf} + $RPM_BUILD_ROOT%{_datadir}/%{name}/tools/{*.pl} # Apache configuration install -p -m 644 tools/httpd_conf $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf -perl -pi -e 's|/usr/local|%{_datadir}|g;s|Allow from all|Allow from 127.0.0.1|g' \ - $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf -echo "# Additional Perl modules - - SetEnv PERL5LIB %{_datadir}/awstats/lib:%{_datadir}/awstats/plugins -" >> $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf +# move to awstats-7.0-httpd-2.4.patch +#perl -pi -e 's|/usr/local|%{_datadir}|g;s|Allow from all|Allow from 127.0.0.1|g' \ +# $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf +#echo "# Additional Perl modules +# +# SetEnv PERL5LIB %{_datadir}/awstats/lib:%{_datadir}/awstats/plugins +#" >> $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf # Cron job install -m 0755 awstats.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/%{name}