Awstats

From GHER

Jump to: navigation, search

Install and migrate awstats on Ubuntu 14.04 (adapted from https://help.ubuntu.com/community/AWStats)

Awstats config

sudo apt-get install awstats
sudo scp abarth@gher-diva.phys.ulg.ac.be:/etc/awstats/awstats.g*.conf /etc/awstats/

Apache config

Create file /etc/apache2/conf-available/awstats.conf

sudo emacs -nw /etc/apache2/conf-available/awstats.conf

with the content

Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon/ "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /awstats/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script .cgi .pl
<FilesMatch "awstats.pl">
AuthName "Login Required"
AuthType Basic
AuthUserFile /var/www/.htpasswd
require valid-user
</FilesMatch>
sudo a2enconf awstats 
sudo a2enmod cgid
sudo scp abarth@gher-diva.phys.ulg.ac.be:/var/www/.htpasswd /var/www/.htpasswd
sudo service apache2 restart

Cron job

sudo mkdir /root/bin
sudo scp abarth@gher-diva.phys.ulg.ac.be:/root/bin/awstats-update /root/bin/
cd /etc/cron.d 
sudo scp abarth@gher-diva.phys.ulg.ac.be:/etc/cron.d/awstats  .
Personal tools