User Tools

Site Tools


linux:ubuntu:awstats

AWStats

Installation

sudo apt-get install awstats

Configuration

Logrotate

Copy this in “/etc/logrotate.d/awstats

awstats
/var/log/apache2/*_log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 644 root root
    sharedscripts
prerotate
        /usr/local/awstats/tools/awstats_updateall.pl now > /dev/null
endscript
postrotate
        /etc/init.d/apache2 reload > /dev/null
endscript
}

Troubleshooting

No refs, no OS info

Description:

The list of refs and OS info is empty because of a wrong perl version. Error occurs with perl above 5.10.0.
Check your version with:

perl -v
Reason:

Perl changed some things which mess up the awstats perl file

Fix:

Open your awstats.pl

vi /usr/local/awstats/wwwroot/cgi-bin/awstats.pl

Line 1354, comment

if (/\(\?[-\w]*:(.*)\)/) { $1 }

insert “UnCompileRegex($_)”

OptimizeArray {
my $array = shift;
my @arrayunreg = map { UnCompileRegex($_) } @$array;
my $notcasesensitive = shift;

Line 7812, comment

shift =~ /(\?[-\w]:(.))/;

insert “shift =~ /(\?[-^\w]:(.))/;”

UnCompileRegex {
shift =~ /(\?[-^\w]:(.))/;
return $1;
}



linux/ubuntu/awstats.txt · Last modified: 2018/12/20 17:40 by lunetikk