Hello!

Here's a patch that does the basics for replacing apache with apache2 as
the default, since apache was removed after etch and we now only have
one version (apache2).


For extra bonus points, we could fix #229285 by doing:

reuse example apache config for apache2 (svn move debian/examples/apache.conf 
debian/apache.conf)
comment out everything except the Alias (or atleast everything with security 
concerns).
Add "debian/apache.conf /etc/apache2/conf.d/awstats" to debian/awstats.install
Drop debian/examples/apache.conf in debian/rules.


Comments?

--
Regards,
Andreas Henriksson
Index: debian/control
===================================================================
--- debian/control	(revision 103)
+++ debian/control	(working copy)
@@ -13,7 +13,7 @@
 Architecture: all
 Depends: ${perl:Depends}, perl (>= 5.8.0-7) | libstorable-perl, perl (>= 5.8.0-7) | libtime-hires-perl
 Recommends: libnet-xwhois-perl
-Suggests: apache | httpd, libnet-dns-perl, libnet-ip-perl, libgeo-ipfree-perl
+Suggests: apache2 | httpd, libnet-dns-perl, libnet-ip-perl, libgeo-ipfree-perl
 Description: powerful and featureful web server log analyzer
  Advanced Web Statistics (AWStats) is a powerful web server logfile
  analyzer written in perl that shows you all your web statistics including
Index: debian/control.in
===================================================================
--- debian/control.in	(revision 103)
+++ debian/control.in	(working copy)
@@ -13,7 +13,7 @@
 Architecture: all
 Depends: ${perl:Depends}, perl (>= 5.8.0-7) | libstorable-perl, perl (>= 5.8.0-7) | libtime-hires-perl
 Recommends: libnet-xwhois-perl
-Suggests: apache | httpd, libnet-dns-perl, libnet-ip-perl, libgeo-ipfree-perl
+Suggests: apache2 | httpd, libnet-dns-perl, libnet-ip-perl, libgeo-ipfree-perl
 Description: powerful and featureful web server log analyzer
  Advanced Web Statistics (AWStats) is a powerful web server logfile
  analyzer written in perl that shows you all your web statistics including
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 103)
+++ debian/changelog	(working copy)
@@ -3,6 +3,7 @@
   [ Andreas Henriksson ]
   * Add debian/patches/1005_at-amp-t.patch (Closes: #478968)
   * Add myself to Uploaders.
+  * Replace apache with apache2 as default config choice. (Closes: #257832)
 
   [ Charles Fry ]
   * Disable warnings for Perl < 5.6 (Closes: #432096, #440035)
Index: debian/rules
===================================================================
--- debian/rules	(revision 103)
+++ debian/rules	(working copy)
@@ -37,7 +37,7 @@
 #  * Single-quoting ('...') protects against shell expansion
 #  * Double-dollar ($$) expands to plain dollar ($) in make
 	perl -wpe \
-	's,^(LogFile\s*=\s*).*,$$1"/var/log/apache/access.log",;'\
+	's,^(LogFile\s*=\s*).*,$$1"/var/log/apache2/access.log",;'\
 	's,^(DirData\s*=\s*).*,$$1"/var/lib/awstats",;'\
 	's,^(LogFormat\s*=\s*).*,$${1}4,;'\
 	's,^(DNSLookup\s*=\s*).*,$${1}1,;'\
Index: debian/awstats.cron.d
===================================================================
--- debian/awstats.cron.d	(revision 103)
+++ debian/awstats.cron.d	(working copy)
@@ -1 +1 @@
-0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.conf -a -r /var/log/apache/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null
+0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl ] && [ -f /etc/awstats/awstats.conf ] && [ -r /var/log/apache2/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null
Index: debian/examples/redostats.sh
===================================================================
--- debian/examples/redostats.sh	(revision 103)
+++ debian/examples/redostats.sh	(working copy)
@@ -17,7 +17,7 @@
 fi
 rm -f *.txt *.bak
 
-TMPLOG=/tmp/access.log
+TMPLOG=`mktemp -t access.log.XXXXXXXX`
 TMPCRON=$CONFDIR/awstats.cron
 CRONORIG=/etc/cron.d/awstats
 CONFORIG=$CONFDIR/conf.orig
@@ -27,11 +27,11 @@
 
 mv -f $CONFFILE $CONFORIG
 cat $CONFORIG |
-  sed "\|/var/log/apache/access.log|s||$TMPLOG|" > $CONFFILE
+  sed "\|/var/log/apache2/access.log|s||$TMPLOG|" > $CONFFILE
 mv -f $CRONORIG $TMPCRON
 /etc/init.d/cron reload
 
-ls -rt /var/log/apache/access.log* |
+ls -rt /var/log/apache2/access.log* |
   while read file
     do zcat -f $file > $TMPLOG
     echo Processing ${file}...

Reply via email to