Package: awstats Version: 7.1.1~dfsg-2 Severity: normal Tags: patch awstats_configure.pl does not work correctly with debian 7.2, tested with the latest version in wheezy and sid. It attepmts to use files and directories that don't exist (%AWSTATSDIR%/wwwroot and awstats.model.conf). I have attached a patch that uses the files and directories present on debian instead, it also doesn't prompt about using a non-standard directory for awstats, as it is installed in a non-standard directory by the package.
The patch should work with both the version in wheezy and the one in sid. -- System Information: Debian Release: 7.2 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-042stab072.10 (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash Versions of packages awstats depends on: ii perl 5.14.2-21+deb7u1 Versions of packages awstats recommends: ii coreutils 8.13-3.5 ii libnet-xwhois-perl 0.90-3 Versions of packages awstats suggests: ii apache2-mpm-prefork [httpd] 2.2.22-13 pn libgeo-ipfree-perl <none> pn libnet-dns-perl <none> pn libnet-ip-perl <none> pn liburi-perl <none> -- Configuration Files: /etc/awstats/awstats.conf changed [not included] -- no debconf information
diff -rupN awstats-7.1.1~dfsg/tools/awstats_configure.pl awstats-7.1.1~dfsg-patched/tools/awstats_configure.pl --- awstats-7.1.1~dfsg/tools/awstats_configure.pl 2013-12-07 05:06:38.000000000 +1100 +++ awstats-7.1.1~dfsg-patched/tools/awstats_configure.pl 2013-12-07 06:07:22.939565169 +1100 @@ -29,11 +29,11 @@ $AWSTATS_MODEL_CONFIG $AWSTATS_DIRDATA_PATH /; $AWSTATS_PATH=''; -$AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon'; +$AWSTATS_ICON_PATH='/usr/share/awstats/icon'; $AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css'; $AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes'; $AWSTATS_CGI_PATH='/usr/local/awstats/wwwroot/cgi-bin'; -$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf'; # Used only when configure ran on linux +$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.conf'; # Used only when configure ran on linux $AWSTATS_DIRDATA_PATH='/var/lib/awstats'; # Used only when configure ran on linux @@ -309,26 +309,26 @@ if ($OS eq 'linux') { $AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//; $AWSTATS_PATH=~s/tools[\\\/]?$//; $AWSTATS_PATH=~s/[\\\/]$//; - if ($AWSTATS_PATH ne '/usr/local/awstats') { - print "Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.\n"; - print "If you want to use standard directory, you should first move all content\n"; - print "of AWStats distribution from current directory:\n"; - print "$AWSTATS_PATH\n"; - print "to standard directory:\n"; - print "/usr/local/awstats\n"; - print "And then, run configure.pl from this location.\n"; - print "Do you want to continue setup from this NON standard directory [yN] ? "; - my $bidon=''; - while ($bidon !~ /^[yN]/i) { $bidon=<STDIN>; } - if ($bidon !~ /^y/i) { - print "configure.pl aborted.\n"; - exit 1; - } - $AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; - $AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; - $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; - $AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; - } +# if ($AWSTATS_PATH ne '/usr/local/awstats') { +# print "Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.\n"; +# print "If you want to use standard directory, you should first move all content\n"; +# print "of AWStats distribution from current directory:\n"; +# print "$AWSTATS_PATH\n"; +# print "to standard directory:\n"; +# print "/usr/local/awstats\n"; +# print "And then, run configure.pl from this location.\n"; +# print "Do you want to continue setup from this NON standard directory [yN] ? "; +# my $bidon=''; +# while ($bidon !~ /^[yN]/i) { $bidon=<STDIN>; } +# if ($bidon !~ /^y/i) { +# print "configure.pl aborted.\n"; +# exit 1; +# } + #$AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; + #$AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; + #$AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; + #$AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; +# } } elsif ($OS eq 'macosx') { $AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//; @@ -504,38 +504,38 @@ foreach my $key (keys %ApacheConfPath) { print CONF "# Directives to allow use of AWStats as a CGI$CR\n"; print CONF "#$CR\n"; } - if (! $awstatsclassesfound) { - print " Add 'Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"'\n"; - print CONF "Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"$CR\n"; - } - if (! $awstatscssfound) { - print " Add 'Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"'\n"; - print CONF "Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"$CR\n"; - } +# if (! $awstatsclassesfound) { +# print " Add 'Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"'\n"; +# print CONF "Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"$CR\n"; +# } +# if (! $awstatscssfound) { +# print " Add 'Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"'\n"; +# print CONF "Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"$CR\n"; +# } if (! $awstatsiconsfound) { print " Add 'Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"'\n"; print CONF "Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"$CR\n"; } - if (! $awstatscgifound) { - print " Add 'ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"'\n"; - print CONF "ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"$CR\n"; - } - if (! $awstatsdirectoryfound) { - print " Add '<Directory>' directive\n"; - print CONF "$CR\n"; -print CONF <<EOF; +# if (! $awstatscgifound) { +# print " Add 'ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"'\n"; +# print CONF "ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"$CR\n"; +# } +# if (! $awstatsdirectoryfound) { +# print " Add '<Directory>' directive\n"; +# print CONF "$CR\n"; +#print CONF <<EOF; # # This is to permit URL access to scripts/files in AWStats directory. # -<Directory "$AWSTATS_PATH/wwwroot"> - Options None - AllowOverride None - Order allow,deny - Allow from all -</Directory> - -EOF - } +#<Directory "$AWSTATS_PATH/wwwroot"> +# Options None +# AllowOverride None +# Order allow,deny +# Allow from all +#</Directory># +# +#EOF +# } close CONF; $UseAlias=1; $WebServerChanged=1; @@ -569,7 +569,7 @@ if (-s $modelfile && -w $modelfile) { elsif ($OS eq 'windows') { $ConfToChange{'DirData'}='.'; } else { $ConfToChange{'DirData'}='.'; } if ($UseAlias) { - $ConfToChange{'DirCgi'}='/awstats'; + $ConfToChange{'DirCgi'}='/cgi-bin'; $ConfToChange{'DirIcons'}='/awstatsicons'; } update_awstats_config("$modelfile"); @@ -638,7 +638,7 @@ if ($bidon =~ /^y/i) { if ($OS eq 'linux' || $OS eq "macosx") { $ConfToChange{'DirData'}="$AWSTATS_DIRDATA_PATH"; } if ($OS eq 'windows') { $ConfToChange{'DirData'}='.'; } if ($UseAlias) { - $ConfToChange{'DirCgi'}='/awstats'; + $ConfToChange{'DirCgi'}='/cgi-bin'; $ConfToChange{'DirIcons'}='/awstatsicons'; } $ConfToChange{'SiteDomain'}="$site";
diff -rupN awstats-7.1.1~dfsg/tools/awstats_configure.pl awstats-7.1.1~dfsg-patched/tools/awstats_configure.pl --- awstats-7.1.1~dfsg/tools/awstats_configure.pl 2013-12-07 05:06:38.000000000 +1100 +++ awstats-7.1.1~dfsg-patched/tools/awstats_configure.pl 2013-12-07 06:07:22.939565169 +1100 @@ -29,11 +29,11 @@ $AWSTATS_MODEL_CONFIG $AWSTATS_DIRDATA_PATH /; $AWSTATS_PATH=''; -$AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon'; +$AWSTATS_ICON_PATH='/usr/share/awstats/icon'; $AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css'; $AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes'; $AWSTATS_CGI_PATH='/usr/local/awstats/wwwroot/cgi-bin'; -$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf'; # Used only when configure ran on linux +$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.conf'; # Used only when configure ran on linux $AWSTATS_DIRDATA_PATH='/var/lib/awstats'; # Used only when configure ran on linux @@ -309,26 +309,26 @@ if ($OS eq 'linux') { $AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//; $AWSTATS_PATH=~s/tools[\\\/]?$//; $AWSTATS_PATH=~s/[\\\/]$//; - if ($AWSTATS_PATH ne '/usr/local/awstats') { - print "Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.\n"; - print "If you want to use standard directory, you should first move all content\n"; - print "of AWStats distribution from current directory:\n"; - print "$AWSTATS_PATH\n"; - print "to standard directory:\n"; - print "/usr/local/awstats\n"; - print "And then, run configure.pl from this location.\n"; - print "Do you want to continue setup from this NON standard directory [yN] ? "; - my $bidon=''; - while ($bidon !~ /^[yN]/i) { $bidon=<STDIN>; } - if ($bidon !~ /^y/i) { - print "configure.pl aborted.\n"; - exit 1; - } - $AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; - $AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; - $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; - $AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; - } +# if ($AWSTATS_PATH ne '/usr/local/awstats') { +# print "Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.\n"; +# print "If you want to use standard directory, you should first move all content\n"; +# print "of AWStats distribution from current directory:\n"; +# print "$AWSTATS_PATH\n"; +# print "to standard directory:\n"; +# print "/usr/local/awstats\n"; +# print "And then, run configure.pl from this location.\n"; +# print "Do you want to continue setup from this NON standard directory [yN] ? "; +# my $bidon=''; +# while ($bidon !~ /^[yN]/i) { $bidon=<STDIN>; } +# if ($bidon !~ /^y/i) { +# print "configure.pl aborted.\n"; +# exit 1; +# } + #$AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; + #$AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; + #$AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; + #$AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; +# } } elsif ($OS eq 'macosx') { $AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//; @@ -504,38 +504,38 @@ foreach my $key (keys %ApacheConfPath) { print CONF "# Directives to allow use of AWStats as a CGI$CR\n"; print CONF "#$CR\n"; } - if (! $awstatsclassesfound) { - print " Add 'Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"'\n"; - print CONF "Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"$CR\n"; - } - if (! $awstatscssfound) { - print " Add 'Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"'\n"; - print CONF "Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"$CR\n"; - } +# if (! $awstatsclassesfound) { +# print " Add 'Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"'\n"; +# print CONF "Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"$CR\n"; +# } +# if (! $awstatscssfound) { +# print " Add 'Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"'\n"; +# print CONF "Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"$CR\n"; +# } if (! $awstatsiconsfound) { print " Add 'Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"'\n"; print CONF "Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"$CR\n"; } - if (! $awstatscgifound) { - print " Add 'ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"'\n"; - print CONF "ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"$CR\n"; - } - if (! $awstatsdirectoryfound) { - print " Add '<Directory>' directive\n"; - print CONF "$CR\n"; -print CONF <<EOF; +# if (! $awstatscgifound) { +# print " Add 'ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"'\n"; +# print CONF "ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"$CR\n"; +# } +# if (! $awstatsdirectoryfound) { +# print " Add '<Directory>' directive\n"; +# print CONF "$CR\n"; +#print CONF <<EOF; # # This is to permit URL access to scripts/files in AWStats directory. # -<Directory "$AWSTATS_PATH/wwwroot"> - Options None - AllowOverride None - Order allow,deny - Allow from all -</Directory> - -EOF - } +#<Directory "$AWSTATS_PATH/wwwroot"> +# Options None +# AllowOverride None +# Order allow,deny +# Allow from all +#</Directory># +# +#EOF +# } close CONF; $UseAlias=1; $WebServerChanged=1; @@ -569,7 +569,7 @@ if (-s $modelfile && -w $modelfile) { elsif ($OS eq 'windows') { $ConfToChange{'DirData'}='.'; } else { $ConfToChange{'DirData'}='.'; } if ($UseAlias) { - $ConfToChange{'DirCgi'}='/awstats'; + $ConfToChange{'DirCgi'}='/cgi-bin'; $ConfToChange{'DirIcons'}='/awstatsicons'; } update_awstats_config("$modelfile"); @@ -638,7 +638,7 @@ if ($bidon =~ /^y/i) { if ($OS eq 'linux' || $OS eq "macosx") { $ConfToChange{'DirData'}="$AWSTATS_DIRDATA_PATH"; } if ($OS eq 'windows') { $ConfToChange{'DirData'}='.'; } if ($UseAlias) { - $ConfToChange{'DirCgi'}='/awstats'; + $ConfToChange{'DirCgi'}='/cgi-bin'; $ConfToChange{'DirIcons'}='/awstatsicons'; } $ConfToChange{'SiteDomain'}="$site";