Télécharger Webalizer à l’adresse suivante :


Copier le fichier webalizer-2.23-08-src.tgz dans /usr/local

tar xzvf webalizer-2.23-08-src.tgz

cd webalizer-2.23-08



make install

cp /usr/local/etc/webalizer.conf.sample /usr/local/etc/webalizer.conf

Editer le fichier webalizer.conf (pour ma part j’utilise vim, d’autres utiliseront nano)
root@vps317218:/usr/local/etc# egrep -v '^(#|$)' webalizer.conf

LogFile /var/log/squid3/access.log
LogType squid
OutputDir /var/www/html/webalizer
HistoryName webalizer.hist
Incremental yes
IncrementalName webalizer.current
ReportTitle Usage Statistics for
HostName proxy vps317218.ovh.net
PageType htm*
PageType cgi
HTAccess yes
HTMLPre <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
HTMLHead <META NAME="author" CONTENT="The Webalizer">
HTMLBody <BODY BGCOLOR="#E8E8E8" TEXT="#000000" LINK="#0000FF" VLINK="#FF0000">
FlagDir flags
DailyGraph yes
DailyStats yes
HourlyGraph yes
HourlyStats yes
GraphLegend yes
TopSites 20
TopKSites 20
TopURLs 30
TopKURLs 10
TopReferrers 20
TopAgents 20
TopCountries 20
TopEntry 20
TopExit 20
TopSearch 20
TopUsers 20
AllUsers yes
HideURL *.gif
HideURL *.jpg
HideURL *.png
HideURL *.ra

Tout est configurable, ce qui est important

LogFile /var/log/squid3/access.log (le fichier log à analyser)
LogType squid (selon ce que l'on veut analyser, la valeur par défaut est "clf", les valeurs peuvent être "w3c", "ftp", "squid")
OutputDir /var/www/html/webalizer (le chemin où se trouve les fichiers html, dossier webalizer doit être créé)

Ensuite exécuter webalizer puis se rendre sur la page http://localhost/webalizer


On peut éditer cron pour que la mise à jour se fasse tous les jours

crontab -e

ajouter @daily /usr/local/bin/webalizer

root@vps317218:/usr/local/etc# crontab -l
# Edit this file to introduce tasks to be run by cron.
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# For more information see the manual pages of crontab(5) and cron(8)
# m h dom mon dow command
@daily /usr/local/bin/webalizer