Sie sind auf Seite 1von 6

02/08/13

INSTALLATION ANALYSEUR DE LOG PROXY SQUID AVEC AWSTATS | POMENTE Guillaume

POMENTE GUILLAUME
Le partage, un esprits sans limites
Accueil Contact propos

INSTALLATION CONFIGURATION LINSHARE AVEC LIAISON LDAP ou ACTIVE DIRECTORY SUR DEBIAN
LinShare est une application de partage de fichiers scuris libre et gratuite, dveloppe et distribue par l'entreprise Linagora selon les mthodes de dveloppement du logiciel libre/open source. LinShare permet la mise en place [more]

INSTALLATION ANALYSEUR DE LOG PROXY SQUID AVEC AWSTATS


Publi le Lundi, novembre 19th, 2012 by in Debian, guillaume pomente, Linux, POMENTE Guillaume, Tuto / Howto / tutorial with Pas de commentaires

Recherche

La solution proxy squid produit des fichiers logs quil est intressant de regarder via une interface web. Voici comment mettre en place un analyseur de fichiers log pour squid avec AWSTATs.

vmware server configuration active serveur 2008 POMENTE 2008 installation synchronisation erreur windows web 2008 2.0 R2 Guillaume creationdirectory squeeze Microsoft pomente dsactiver squidguard squid mysql NTP

sauvegarde zimbra GLPI script R2 utilisateur guillaume esxi 4.1 Ubuntu vmware automatique ajout powershell serveur how to zimbra ESXi7 windows tuto

Debian

1 Installation dApache
Awstat gnre des pages web, il est donc ncessaire dinstaller un serveur http. Dans mon cas je vais utiliser Apache.
aptitude install apache2

ARTICLES RCENTS

2 Installation dAWSTATs
AWStats est un outils gratuits qui permet danalyser des fichiers LOGs en les retranscrivant sous forme de pages web
aptitude install awstats Cration des dossier wwwroot et cgibin mkdir /usr/share/doc/awstats/examples/wwwroot mkdir /usr/share/doc/awstats/examples/wwwroot/cgi-bin Extraction du fichier de configuration cd /usr/share/doc/awstats/examples/ gzip -d /usr/share/doc/awstats/examples/awstats.model.conf.gz Copie du fichier de configuration cp /usr/share/doc/awstats/examples/awstats.model.conf /usr/share/doc/awstats/examples/wwwroot/cgi-bin/ Execution du script de configuration cd /usr/share/doc/awstats/examples/ perl awstats_configure.pl

INSTALLATION CONFIGURATION LINSHARE AVEC LIAISON LDAP ou ACTIVE DIRECTORY SUR DEBIAN INSTALLATION ET CONFIGURATION TERMINAL SERVEUR APPREMOTE SUR WINDOWS 2008 R2 DEPOT POUR DEBIAN WHEEZY TUTO SERVEUR CALENDRIER AVEC DAVICAL ET AGENDAV SOUS DEBIAN IMPRESSION EN BOUCLE SUR IMPRIMANTE LOCALE

www.guillaume-p.net/installation-analyseur-log-proxy-squid-awstats/

1/6

02/08/13

INSTALLATION ANALYSEUR DE LOG PROXY SQUID AVEC AWSTATS | POMENTE Guillaume


AWStats awstats_configure 1.0 (build 1.8) (c) Laurent Destailleur This tool will help you to configure AWStats to analyze statistics for one web server. You can try to use it to let it do all that is possible in AWStats setup, however following the step by step manual setup documentation (docs/index.html) is often a better idea. Above all if: - You are not an administrator user, - You want to analyze downloaded log files without web server, - You want to analyze mail or ftp log files instead of web log files, - You need to analyze load balanced servers log files, - You want to understand all possible ways to use AWStats Read the AWStats documentation (docs/index.html).

> Running OS detected: Linux, BSD or Unix Warning: AWStats standard directory on Linux OS is /usr/local/awstats. If you want to use standard directory, you should first move all content of AWStats distribution from current directory: /usr/share/doc/awstats/examples to standard directory: /usr/local/awstats And then, run configure.pl from this location. Do you want to continue setup from this NON standard directory [yN] ? Y

> Check for web server install

Enter full config file path of your Web server. Example: /etc/httpd/httpd.conf Example: /usr/local/apache2/conf/httpd.conf Example: c:\Program files\apache group\apache\conf\httpd.conf Config file path (none to skip web server setup): > /etc/apache2/apache2.conf

> Check and complete web server config file /etc/apache2/apache2.conf Add Alias /awstatsclasses /usr/share/doc/awstats/examples/wwwroot/classes/ Add Alias /awstatscss /usr/share/doc/awstats/examples/wwwroot/css/ Add Alias /awstatsicons /usr/share/doc/awstats/examples/wwwroot/icon/

www.guillaume-p.net/installation-analyseur-log-proxy-squid-awstats/

2/6

02/08/13

INSTALLATION ANALYSEUR DE LOG PROXY SQUID AVEC AWSTATS | POMENTE Guillaume


Add ScriptAlias /awstats/ /usr/share/doc/awstats/examples/wwwroot/cgi-bin/ Add <Directory> directive AWStats directives added to Apache config file.

> Update model config file /usr/share/doc/awstats/examples/wwwroot/cgibin/awstats.model.conf File awstats.model.conf updated.

> Need to create a new config file ? Do you want me to build a new AWStats config/profile file (required if first install) [y/N] ?Y

> Define config file name to create What is the name of your web site or profile analysis ? Example: www.mysite.com Example: demo Your web site, virtual server or profile name: > NOMDEVOTRESERVEURSQUID

> Define config file path In which directory do you plan to store your config file(s) ? Default: /etc/awstats Directory path to store config file(s) (Enter for default): > [ENTRE]

A SIMPLE config file has been created: /etc/awstats/awstats.SrvProxy.conf You should have a look inside to check and change manually main parameters. You can then manually update your statistics for SrvProxy with command: > perl awstats.pl -update -config=SrvProxy You can also read your statistics for SrvProxy with URL: > http://localhost/awstats/awstats.pl?config=SrvProxy

Press ENTER to finish [ENTRE]

www.guillaume-p.net/installation-analyseur-log-proxy-squid-awstats/

3/6

02/08/13

INSTALLATION ANALYSEUR DE LOG PROXY SQUID AVEC AWSTATS | POMENTE Guillaume


Editer le fichier de configuration
nano /etc/awstats/awstats.NOMDEVOTRESERVEURSQUID.conf

Modifier les lignes suivantes :


LogFile= /var/log/squid/access.log LogFormat= %host %other %logname %time1 %methodurl %code %bytesd %other SiteDomain= NOMDEVOTRESERVEURSQUID

2-1 Configuration de Squid pour AWSTATs


nano /etc/squid/squid.conf Ajouter les lignes suivantes avant les ACLs
# Configuration pour AWStats logformat full %>a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] %rm %ru HTTP/%rv %Hs %<st %{Referer}>h %{User-Agent}>h - %tr %{Host}>h access_log /var/log/squid/access.log full Redmarrer Squid

/etc/init.d/squid restart Gnrer les premieres statistiques /usr/lib/cgi-bin/awstats.pl -config=NOMDEVOTRESERVEURSQUID update /!\ Si votre serveur Squid a dj gnrer les logs, vous allez surement avoir des erreurs au lancement de la commande /!\ Exemple derreurs : Create/Update database for config /etc/awstats/awstats.NOMDEVOTRESERVEURSQUID.conf by A WStats version 6.95 (build 1.943) From data in log file /var/log/squid/access.log Phase 1 : First bypass old records, searching new record Searching new records from beginning of log file AWStats did not find any valid log lines that match your LogFormat paramete r, in the 50th first non commented lines read of your log. Your log file /var/log/squid/access.log must have a bad format or LogFormat parameter setup does not match this format. Your AWStats LogFormat parameter is: %host %other %logname %time1 %methodurl %code %bytesd %other This means each line in your web server log file need to have the following personalized log format: %host %other %logname %time1 %methodurl %code %bytesd %other And this is an example of records AWStats found in your log file (the recor d number 50 in your log): 1555482948.360 140 ip.client TCP_MISS/504 1585 GET http://site.com/

www.guillaume-p.net/installation-analyseur-log-proxy-squid-awstats/

4/6

02/08/13

INSTALLATION ANALYSEUR DE LOG PROXY SQUID AVEC AWSTATS | POMENTE Guillaume


DIRECT/127.0.0.1 text/html Setup (/etc/awstats/awstats.NOMDEVOTRESERVEURSQUID.conf file, web server or permissions ) may be wrong. Check config file, permissions and AWStats documentation (in docs directo ry). Pour rsoudre cet erreur supprimer le contenu du fichier /var/log/squid/access.log nano /var/log/squid/access.log Supprimer toutes les lignes Gnrer a nouveau les statistiques /usr/lib/cgi-bin/awstats.pl -config=NOMDEVOTRESERVEURSQUID update Create/Update database for config /etc/awstats/awstats.NOMDEVOTRESERVEURSQUID.conf by AWStats version 6.95 (build 1.943) From data in log file /var/log/squid/access.log Phase 1 : First bypass old records, searching new record Searching new records from beginning of log file Phase 2 : Now process new records (Flush history on disk after 20000 hosts) Jumped lines in file: 0 Parsed lines in file: 30 Found 0 dropped records, Found 15 corrupted records, Found 0 old records, Found 15 new qualified records. http://IP.DE.VOTRE.SERVEUR.AWSTATS/cgi-bin/awstats.pl? config=NOMDEVOTRESERVEURSQUID Les stats apparaissent.

Si vous navez pas les images qui saffichent, crer un lien symbolique ln -s /usr/share/awstats/icon/ /var/www/awstats-icon

2-2 Planifi la generation des stats

Pour gnr les stats priodiquement, diter la cron crontab -e

www.guillaume-p.net/installation-analyseur-log-proxy-squid-awstats/

5/6

02/08/13

INSTALLATION ANALYSEUR DE LOG PROXY SQUID AVEC AWSTATS | POMENTE Guillaume


Ajouter la ligne suivante la fin du fichier. Tous les jours 7h du matin une mise jour sera effectue 0 7 * * * perl /usr/lib/cgi-bin/awstats.pl -config=NOMDEVOTRESERVEURSQUID -update Redmarrer la cron /etc/init.d/cron restart

Auteur : POMENTE Guillaume

Mots-Cls

Poster un commentaire Pas de commentaires

Laisser un commentaire

Votre adresse de messagerie ne sera pas publie. Les champs obligatoires sont indiqus avec *
Nom *

Adresse de contact *

Site w eb

Commentaire

Vous pouvez utiliser ces balises et attributs HTML : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Laisser un commentaire

Copyright 2012 POMENTE Guillaume - Powered by WordPress

www.guillaume-p.net/installation-analyseur-log-proxy-squid-awstats/

6/6

Das könnte Ihnen auch gefallen