Tuesday 21 June 2011

AWSTATS on Apache with Ubuntu Server 10.04 LTS

Got this working today.   Nice guide here covers most of it.  Another good guide is here.

To enable Perl on Apache:
apt-get install libapache2-mod-perl2
vi /etc/apache2/sites-enabled/www.example.com
Add:-
<Files ~ "\.(pl|cgi)$">
   SetHandler perl-script
   PerlResponseHandler ModPerl::Registry
   Options +ExecCGI
   PerlSendHeader On
   AuthName "AWStats Authentication"
   AuthType Basic
   AuthUserFile /example/path/to/.htpasswd_www.example.com
   Require valid-user
</Files>

If you're paranoid about security, it may be better to configure AWSTATS to run in static mode only.

It may also be sensible to update awstats manually to the latest stable version.  I just did this by searching for files on the server and replacing them with the new versions, though this is a bit tedious due to the way that Ubuntu's package installer spreads the distribution files around the filesystem.  Finally it's necessary to restart Apache so that mod_perl doesn't run the old code.

No comments:

Post a Comment

Spammers: please stop wasting my time. All comments are moderated before publication.