Eric
samedi mai 02, 2009
awstat statistique d'utilisation sous apache
awstat
- Statistique d'utilisation d'apache.
# cd /export/home1/adm/source # mkdir awstats # cd awstats # wget http://voxel.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz # su - user1 $ cp /export/home1/adm/source/awstats/awstats-6.9.tar.gz htdocs/awstats/ $ cd htdocs/awstats $ gunzip awstats-6.9.tar.gz $ tar xvf awstats-6.9.tar $ rm awstats-6.9.tar $ exit
- Configuration de awstats
- Adjuster les logs au format combined. (CustomLog)
# vi /opt/coolstack/apache2/conf/httpd.conf <IfModule log_config_module> # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do* # define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file. # #CustomLog logs/access_log common # # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # CustomLog logs/access_log combined </IfModule>
- Adjuster les logs au format combined. (CustomLog)
- Ajouter les Alias pour le web.
# vi /opt/coolstack/apache2/conf/extra/httpd-awstats.conf
# Cants.org/GNU # Config fait par Eric Cantin # Alias /awstatsclasses "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/classes/" Alias /awstatscss "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/css/" Alias /awstatsicons "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/icon/" ScriptAlias /awstats/ "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/cgi-bin/" # # This is to permit URL access to scripts/files in AWStats directory. # <Directory "/export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot"> Options None AllowOverride None Order allow,deny Allow from all </Directory>
- Inclure la configuration de awstats dans httpd.conf
# vi /opt/coolstack/apache2/conf/httpd.conf
- Ajouter à la fin du fichier.
# awstats-6.9 Include conf/extra/httpd-awstats.conf
- Créer la configuration du site.
# su - user1 $ cd htdocs/awstats/awstats-6.9/wwwroot/cgi-bin $ cp awstats.model.conf awstats.www.modomaine.conf $ chmod 755 awstats.www.mondomaine.conf
- Modifier la configuration du site.
$ vi awstats.www.mondomaine.conf
LogFile="/var/log/httpd/mylog.log" LogFile="/opt/coolstack/apache2/logs/access_log" SiteDomain="" SiteDomain="www.mondomaine" DNSLookup=2 DNSLookup=1 DirData="." DirData="/export/home1/daemons/apache/htdocs/awstats/logs" DirIcons="/icon" DirIcons="/awstatsicons"
$ mkdir /export/home1/daemons/apache/htdocs/awstats/logs $ chmod -R 777 /export/home1/daemons/apache/htdocs/awstats/logs $ exit
- Redémarrer apache-2.2
# svcadm restart svc:/network/http:apache22-csk
Premier démarrage
- Première execution
# su - user1 $ /export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/cgi-bin/awstats.pl -config=www.mondomaine -update
- Ajouter la tâche au cron
# su - user1 $ crontab -e 25,55 * * * * /export/home1/daemons/apache/htdocs/awstats/awstats-6.9/wwwroot/cgi-bin/awstats.pl -config=www.mondomaine -update > /dev/null 2>&1
Posted at 12:00AM mai 02, 2009 by Éric in php |