<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.livois.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Proxy</id>
	<title>Proxy - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.livois.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Proxy"/>
	<link rel="alternate" type="text/html" href="https://wiki.livois.com/mediawiki/index.php?title=Proxy&amp;action=history"/>
	<updated>2026-05-25T04:48:07Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.livois.com/mediawiki/index.php?title=Proxy&amp;diff=109&amp;oldid=prev</id>
		<title>Christophe : 1 version</title>
		<link rel="alternate" type="text/html" href="https://wiki.livois.com/mediawiki/index.php?title=Proxy&amp;diff=109&amp;oldid=prev"/>
		<updated>2012-05-28T20:31:51Z</updated>

		<summary type="html">&lt;p&gt;1 version&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 28 mai 2012 à 20:31&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;fr&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Aucune différence)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Christophe</name></author>
	</entry>
	<entry>
		<id>https://wiki.livois.com/mediawiki/index.php?title=Proxy&amp;diff=108&amp;oldid=prev</id>
		<title>Christophe : /* Configuration de squidguard */</title>
		<link rel="alternate" type="text/html" href="https://wiki.livois.com/mediawiki/index.php?title=Proxy&amp;diff=108&amp;oldid=prev"/>
		<updated>2009-06-20T15:05:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Configuration de squidguard&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Sécurité]]&lt;br /&gt;
__TOC__&lt;br /&gt;
=Proxy DNS avec BIND=&lt;br /&gt;
&amp;lt;licode file=/etc/conf.d/named&amp;gt;&lt;br /&gt;
CHROOT=&amp;quot;/chroot/dns&amp;quot;&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#emerge --config bind&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier à éditer est: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode file=/chroot/dns/etc/bind/named.conf&amp;gt;&lt;br /&gt;
options {&lt;br /&gt;
        version &amp;quot;&amp;quot;;&lt;br /&gt;
        directory &amp;quot;/var/bind&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        forward first;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                192.168.100.163;&lt;br /&gt;
                192.168.100.164;&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        listen-on-v6 { none; };&lt;br /&gt;
        //listen-on { 127.0.0.1; };&lt;br /&gt;
&lt;br /&gt;
        // to allow only specific hosts to use the DNS server:&lt;br /&gt;
        //allow-query {&lt;br /&gt;
        //      127.0.0.1;&lt;br /&gt;
        //};&lt;br /&gt;
&lt;br /&gt;
        // if you have problems and are behind a firewall:&lt;br /&gt;
        //query-source address * port 53;&lt;br /&gt;
        pid-file &amp;quot;/var/run/named/named.pid&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;.&amp;quot; IN {&lt;br /&gt;
        type hint;&lt;br /&gt;
        file &amp;quot;named.ca&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;localhost&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;pri/localhost&amp;quot;;&lt;br /&gt;
        allow-update { none; };&lt;br /&gt;
        notify no;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;0.0.127.in-addr.arpa&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;pri/127.0.0&amp;quot;;&lt;br /&gt;
        allow-update { none; };&lt;br /&gt;
        notify no;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode file=/chroot/dns/etc/bind/pri/livois.com.zone&amp;gt;&lt;br /&gt;
$TTL 1W&lt;br /&gt;
@       IN      SOA     ns.localhost. root.localhost.  (&lt;br /&gt;
                                      2005121701 ; Serial&lt;br /&gt;
                                      28800      ; Refresh&lt;br /&gt;
                                      14400      ; Retry&lt;br /&gt;
                                      604800     ; Expire - 1 week&lt;br /&gt;
                                      86400 )    ; Minimum&lt;br /&gt;
                IN      NS      ns&lt;br /&gt;
www             IN      A       192.168.10.10&lt;br /&gt;
mail            IN      A       192.168.10.1&lt;br /&gt;
bedouin         IN      A       192.168.100.33&lt;br /&gt;
home            IN      A       192.168.100.2&lt;br /&gt;
ldap            IN      CNAME   www&lt;br /&gt;
ftp             IN      CNAME   www&lt;br /&gt;
monys           IN      CNAME   www&lt;br /&gt;
livois.com.     MX      10      mail&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Relay  SMTP avec Postfix=&lt;br /&gt;
http://www.postfix.org&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;/etc/postfix/main.cf&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Définir les adresses qui peuvent envoyer des mails&lt;br /&gt;
&amp;lt;licode&amp;gt;mynetworks=127.0.0.1,192.168.x.0/24&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Définir le serveur smtp relai par défaut si nécessaire (ex : antivirus)&lt;br /&gt;
&amp;lt;licode&amp;gt;relayhost=relay.livois.com&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Relai vers des serveurs distincts&lt;br /&gt;
Ecrire dans le ficher &amp;lt;tt&amp;gt;/etc/postfix/transport&amp;lt;/tt&amp;gt; une ligne du type :&lt;br /&gt;
&amp;lt;licode file=/etc/postfic/transport&amp;gt;&lt;br /&gt;
postfix.org smtp:smtp.free.fr&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lancer la commande :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#postmap /etc/postfix/transport&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ajouter une ligne du type dans main.cf&lt;br /&gt;
&amp;lt;licode file=/etc/postfix/main.cf&amp;gt;&lt;br /&gt;
transport_maps=hash:/etc/postfix/transport&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote class=warning&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Remarque :&amp;#039;&amp;#039;&amp;#039; Ne pas oublier de lancer la commande /usr/bin/newaliases à l’installation de postfix.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Proxy HTTP et FTP avec Squid=&lt;br /&gt;
http://www.squid-cache.org/&lt;br /&gt;
&lt;br /&gt;
http://christian.caleca.free.fr/squid/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote class=gentoo&amp;gt;Package Gentoo : + customlog&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Remarque :&amp;#039;&amp;#039;&amp;#039; Squid fonctionne bien comme proxy ftp pour mozilla mais pas pour internet explorer ou des clients ftp usuels. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration standard==&lt;br /&gt;
Editer &amp;lt;tt&amp;gt;/etc/squid/squid.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il existe, pour simplifier, deux types de lignes :&lt;br /&gt;
* Les lignes « acl » qui définissent des variables (port, protocole, adresses sources, adresses destination, expressions rationnelles) &lt;br /&gt;
* et les règles d’accès « http_access » qui autorisent (allow) ou non (deny) en fonction de l’association ET des variables « acl ».&lt;br /&gt;
&lt;br /&gt;
Quelques exemples de directives :&lt;br /&gt;
(La liste complète se trouve à l’adresse  http://squid.visolve.com/squid/configuration_manual.htm )&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
!width=250|Exemples de règles!!width=550|Explications&lt;br /&gt;
|-&lt;br /&gt;
|no_cache deny&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;allow aclname&amp;lt;br&amp;gt;ex: no_cache deny nocache||&lt;br /&gt;
Pour que certaines adresses ne soient pas dans le cache (utile pour les webmasters), on utilise la directive no_cache &lt;br /&gt;
|-&lt;br /&gt;
|cache_dir ufs /var/cache/squid 512 16 256||Définit un cache de 512Mo dans /var/squid/cache. Les valeurs 16 et 256 sont le nombre de sous répertoires de niveau 1 et 2. Plus de détails sur http://squid.visolve.com/squid/squid24s1/logfiles.htm#cache_dir.&lt;br /&gt;
|-&lt;br /&gt;
|http_port 8080||La connexion au proxy se fait sur le port 8080. C’est la seule ligne qui n’est ni une variable acl ni une règle d’accès http_access.&lt;br /&gt;
|-&lt;br /&gt;
|acl safe_port port 80 21 443&amp;lt;br&amp;gt;acl http_port port 80&amp;lt;br&amp;gt;acl ftp_port port 21&amp;lt;br&amp;gt;acl ssl_port port 443&lt;br /&gt;
&amp;lt;br&amp;gt;acl http_proto proto http&amp;lt;br&amp;gt;acl ftp_proto proto ftp&amp;lt;br&amp;gt;acl CONNECT method CONNECT&amp;lt;br&amp;gt;&lt;br /&gt;
||Définition des ACLs générales&lt;br /&gt;
|-&lt;br /&gt;
|acl localhost src 127.0.0.1/32&amp;lt;br&amp;gt;acl lan src 192.168.XX.0/24&amp;lt;br&amp;gt;acl all src 0.0.0.0/0.0.0.0&lt;br /&gt;
||Définition des groupes d&amp;#039;accès&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;acl Regexp url_regex -i .wav -i .mp3 -i .mpeg -i .mpg -i .avi&amp;lt;br&amp;gt;&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;http_access deny Regexp all||&lt;br /&gt;
Pour éviter certains téléchargement (la règle n’est pas activée par défaut)&lt;br /&gt;
|-&lt;br /&gt;
|http_access allow CONNECT ssl_port lan&amp;lt;br&amp;gt;http_access allow ftp_port ftp_proto lan&amp;lt;br&amp;gt;http_access allow http_port http_proto lan||Autorisations&lt;br /&gt;
|-&lt;br /&gt;
|acl purge method PURGE&amp;lt;br&amp;gt;http_access allow purge localhost&amp;lt;br&amp;gt;http_access deny purge||&lt;br /&gt;
|-&lt;br /&gt;
|http_access deny all||Règle par défaut&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote class=note&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Remarques :&amp;#039;&amp;#039;&amp;#039;Le paramètre &amp;lt;tt&amp;gt;visible_hostname&amp;lt;/tt&amp;gt; peut être requis pour permettre le lancement de squid.&lt;br /&gt;
Si on ne définit pas deny all, squid fait le contraire de la dernière ligne access ou deny.&lt;br /&gt;
La première ligne lue est la première ligne appliquée.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration “proxy_transparent”==&lt;br /&gt;
http://tldp.org/HOWTO/TransparentProxy.html&lt;br /&gt;
&lt;br /&gt;
* Du côté d’Iptables&lt;br /&gt;
&amp;lt;licode&amp;gt;&lt;br /&gt;
$IPTABLES -t nat -A PREROUTING -i $IF_LAN1 -s $LAN1_NET -p tcp --dport 80 -j DNAT --to $IP_LAN1:8080&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Du côté de squid.conf&lt;br /&gt;
&amp;lt;licode file=/etc/squid/squid.conf&amp;gt;&lt;br /&gt;
httpd_accel_host_virtual&lt;br /&gt;
httpd_accel_port 80&lt;br /&gt;
httpd_accel_with_proxy on&lt;br /&gt;
httpd_accel_uses_host_header on&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration avancée==&lt;br /&gt;
===Limitation du débit===&lt;br /&gt;
Each type of pools allows you to limit bandwith in different ways :&lt;br /&gt;
&amp;lt;licode file=/etc/squid/squid.conf&amp;gt;&lt;br /&gt;
acl XXX&lt;br /&gt;
delay_pool_count 1 #tells squid how many delay pools there will be&lt;br /&gt;
delay_class 1 1 #creates a delay pool (N°1) of class 1&lt;br /&gt;
delay_parameters 1 16000/16000 #pool 1 manipulated, restore/max values&lt;br /&gt;
delay_access 1 allow XXX&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The restore value is used to set the download speed, and the max value lets you the size at which the files are to be slowned down from. Restore is in bytes per second, max is in bytes. In the above example, downloads proceed at full speed until they have downloaded 16000 bytes. This limit ensures that that small file arrive reasonably fast. Once this much data has been transferred, the transfer rate is slowed to 16000 bytes per second (128K)&lt;br /&gt;
&lt;br /&gt;
By using a different pool type, you can set rate limits by IP address easily.&lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;licode&amp;gt;&lt;br /&gt;
acl all src 0/0&lt;br /&gt;
delay_pool_count 1&lt;br /&gt;
delay_class 1 2 &lt;br /&gt;
delay_parameters 1 12500/12500 2500/2500&lt;br /&gt;
delay_access 1 allow all&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here each ip si limited to 2.5kbytes/s (20K)&lt;br /&gt;
&amp;lt;licode&amp;gt;&lt;br /&gt;
acl all src 0/0&lt;br /&gt;
delay_pool_count 1&lt;br /&gt;
delay_class 1 3&lt;br /&gt;
# 56000*8 sets your overall limit at 448 kbit/s&lt;br /&gt;
# 18750*8 sets your per-network limit at 150 kbit/s&lt;br /&gt;
# 500*8 sets your per-user limit at 4 kbit/s &lt;br /&gt;
&lt;br /&gt;
delay_parameters 1 56000/56000 18750/187500 500/500&lt;br /&gt;
delay_access 1 allow all&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ici le per-network correspond à des réseaux de classe C.&lt;br /&gt;
-1 =&amp;gt; no limit&lt;br /&gt;
===Load balancing (TODO)===&lt;br /&gt;
===Transparent caching===&lt;br /&gt;
http://www.deckle.co.za/squid-users-guide/Transparent_Caching&lt;br /&gt;
&lt;br /&gt;
Un proxy transparent est incompatible avec l&amp;#039;authentification pour des raisons internes à TCP.&lt;br /&gt;
&lt;br /&gt;
Il faut :&lt;br /&gt;
* configurer le firewall rediriger les flux TCP vers le port 80 vers le proxy&lt;br /&gt;
&amp;lt;licode&amp;gt;iptables –t nat –A PREROUTING –s network -p tcp --dport 80 –j DNAT --to server:8080&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* configurer squid comme un proxy transparent&lt;br /&gt;
&amp;lt;u&amp;gt;Configuration pour squid 2.6&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE1-RELEASENOTES.html#s2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode file=/etc/squid/squid.conf&amp;gt;&lt;br /&gt;
http_port 192.168.10.1:8080 transparent&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Configuration pour squid &amp;lt; 2.6&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;licode file=/etc/squid/squid.conf&amp;gt;&lt;br /&gt;
httpd_accel_host virtual&lt;br /&gt;
httpd_accel_port 80&lt;br /&gt;
httpd_accel_with_proxy on&lt;br /&gt;
httpd_accel_uses_host_header on&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Communicating with other proxy servers===&lt;br /&gt;
&amp;lt;licode file=/etc/squid/squid.conf&amp;gt;&lt;br /&gt;
cache_peer cache.myparent.example parent 3128 3130 &lt;br /&gt;
prefer_direct off&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
Squid communicates with the parent on HTTP port 3128 and will use ICP to query the server using port 3130. &lt;br /&gt;
&lt;br /&gt;
Pour un passage obligé par le proxy principal (s’il ne comprend pas ICP), rajouter default no-query :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode&amp;gt;cache_peer cache.myparent.example parent 3128 3130 default no-query&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default option essentially tells Squid “ Go through this cache for all requests. If it’s down, return an error message to the client: you cannot go direct”.&lt;br /&gt;
&lt;br /&gt;
The no-query option sets Squid to ignore the given ICP port, and never to attempt to query the cache with ICP.&lt;br /&gt;
&lt;br /&gt;
===Divers===&lt;br /&gt;
&lt;br /&gt;
If squid dies email is sent to the address specified with the &amp;lt;tt&amp;gt;cache_mgr&amp;lt;/tt&amp;gt; tag. This address is also appended to the end of error pages returned to users if, for example, the remote machine is unreachable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode&amp;gt;cache_store_log none&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration de squidguard==&lt;br /&gt;
http://www.squidguard.org/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode file/etc/squid/squid.conf&amp;gt;&lt;br /&gt;
redirect_program /usr/local/squidGuard/bin/squidGuard&lt;br /&gt;
redirect_children 20 &lt;br /&gt;
redirector_bypass on&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
(La 2e ligne limite le nombre de redirecteurs qui prennent de 800Ko à 160Ko de mémoire)&lt;br /&gt;
(La 3e ligne permet de ne pas utiliser de redirecteur s’ils sont tous occupés.)&lt;br /&gt;
&lt;br /&gt;
On peut lier squidguard à un antivirus :&lt;br /&gt;
http://viralator.loddington.com&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode&amp;gt;redirect http://127.0.0.1/viralator.cgi?url=%u&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Logs==&lt;br /&gt;
http://www.squid-cache.org/Scripts/&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;access.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 time elapsed remotehost code/status bytes method URL rfc931 peerstatus/peerhost type&lt;br /&gt;
1097998987.301      4 192.168.10.2 TCP_MEM_HIT/200 620 GET http://awstats.sourceforge.net/icon/other/vk.png - NONE/- image/png&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;squid2common.pl&amp;lt;/tt&amp;gt; transforme les logs squid sous le format clf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] &amp;quot;request&amp;quot; ddd bbbb&amp;lt;br&amp;gt;&lt;br /&gt;
ddd: the status code returned by the server, - if not available. &amp;lt;br&amp;gt;&lt;br /&gt;
bbbb: the total number of bytes sent, *not including the HTTP header*, - if available&amp;lt;br&amp;gt;&lt;br /&gt;
home.livois.com - - [17/Oct/2004:18:49:26 +1000] &amp;quot;GET http://martin.gleeson.com/pwebstats/style.css HTTP/1.0&amp;quot; 200 4664&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* time&lt;br /&gt;
&lt;br /&gt;
A Unix timestamp as UTC seconds with a millisecond resolution. You can convert Unix timestamps into something more human readable using this short perl script: &lt;br /&gt;
&amp;lt;licode&amp;gt;&lt;br /&gt;
        #! /usr/bin/perl -p&lt;br /&gt;
        s/^\d+\.\d+/localtime $&amp;amp;/e;&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Webalizer===&lt;br /&gt;
&amp;lt;blockquote class=gentoo&amp;gt;&lt;br /&gt;
Package Gentoo: webalizer (+xtended,+geoip)&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode file=/etc/crontab&amp;gt;&lt;br /&gt;
0 0 * * * root webalizer -o /var/www/www.livois.com/supervision/squidalizer/ -p -Q -F squid -Y -C 0 -E 0 -e 0 /var/log/squid/access.log&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* -p 		incremental (conserve les données après chaque passage)&lt;br /&gt;
* -C 0		0 TopCountries&lt;br /&gt;
* -S 30 	30 TopSites&lt;br /&gt;
* -Q 		mode silencieux&lt;br /&gt;
* -Y 		n’indique pas la répartition par pays&lt;br /&gt;
* -E 0 		TopExit&lt;br /&gt;
* -e 0 		TopEntry&lt;br /&gt;
* -F squid 	logs de type squid (par défaut clf = log apache)&lt;br /&gt;
* -o 		$WEB/webalizer (repertoire des fichiers html d’output)&lt;br /&gt;
&lt;br /&gt;
Editer /etc/webalizer.conf (les TopK ne peuvent être changés en ligne de commande)&lt;br /&gt;
&amp;lt;licode file=/etc/webalizer.conf&amp;gt;&lt;br /&gt;
TopSites        15&lt;br /&gt;
TopKSites       15 (IP qui utilisent le proxy)&lt;br /&gt;
TopURLs         30 (pages accedées)&lt;br /&gt;
TopKURLs        30&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Awstats===&lt;br /&gt;
Je préfère ne pas utiliser Awstats pour les logs squid car:&lt;br /&gt;
* le format de logs squid n&amp;#039;est pas reconnu automatiquement&lt;br /&gt;
* le protocole « CONNECT » (https) ne semble pas reconnu&lt;br /&gt;
* les URLs sont triées par nombre d&amp;#039;accès et non par volume (débit)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pour changer le format des logs squid, il y a plusieurs façons de faire :&lt;br /&gt;
* mettre la directive emulate_http_log dans squid.conf&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
If your log records are EXACTLY like this (With some Squid versions, after setting emulate_http_log to on):&lt;br /&gt;
200.135.30.181 - - [dd/mmm/yyyy:hh:mm:ss +0x00] &amp;quot;GET http://www.mydomain.com/page.html HTTP/1.0&amp;quot; 200 456 TCP_CLIENT_REFRESH_MISS:DIRECT&lt;br /&gt;
You must use : LogFormat=&amp;quot;%host %other %logname %time1 %methodurl %code %bytesd %other&amp;quot;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* patcher squid 2 (pas nécessaire avec squid 3) http://longsleep.org/howto/squidawstats&lt;br /&gt;
C&amp;#039;est possible avec le flag customlog sous Gentoo :&lt;br /&gt;
&amp;lt;blockquote class=gentoo&amp;gt;Package Gentoo: squid +customlog&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configurer le format des logs de squid:&lt;br /&gt;
&amp;lt;licode file=/etc/squid/squid.conf&amp;gt;&lt;br /&gt;
logformat combined %&amp;gt;a %ui %un [%{%d/%b/%Y:%H:%M:%S +0000}tl] &amp;quot;%rm %ru HTTP/%rv&amp;quot; %Hs %&amp;lt;st &amp;quot;%{Referer}&amp;gt;h&amp;quot; &amp;quot;%{User-Agent}&amp;gt;h&amp;quot; %Ss:%Sh&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote class=note&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Remarque :&amp;#039;&amp;#039;&amp;#039;L&amp;#039;argument passé à la variable %tl permet de mettre la date au format reconnu par awstats. +0000 correspond au &amp;quot;timezone offset&amp;quot;&lt;br /&gt;
Plus d&amp;#039;information sur le patch customlog sont disponibles sur http://devel.squid-cache.org/customlog/.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* transformer access.log au format clf avec &amp;lt;tt&amp;gt;squid2common.pl&amp;lt;/tt&amp;gt; (récupérable avec pwebstats)&lt;br /&gt;
&lt;br /&gt;
Par défaut &amp;lt;tt&amp;gt;squid2common.pl&amp;lt;/tt&amp;gt; créé 2 fichiers (cache.convert et proxy.convert). &lt;br /&gt;
Il faut changer une ligne dans le script pour ne créer qu&amp;#039;un fichier squid.convert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
If your log records are EXACTLY like this (NCSA common CLF log format):&lt;br /&gt;
62.161.78.73 - - [dd/mmm/yyyy:hh:mm:ss +0x00] &amp;quot;GET /page.html HTTP/1.1&amp;quot; 200 1234&lt;br /&gt;
You must use : LogFormat=4&lt;br /&gt;
Note: Browsers, OS&amp;#039;s, Keywords and Referers features are not available with a such format.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Sarg===&lt;br /&gt;
http://sarg.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
Sarg is a Squid Analysis Report Generator that allow you to view &amp;quot;where&amp;quot; your users are going to on the Internet. Sarg generate reports in html, with many fields, like: users, IP Addresses, bytes, sites and times.&lt;br /&gt;
&lt;br /&gt;
===Squidalyser===&lt;br /&gt;
Squidalyser is a squid traffic analyser, designed to allow per-user scrutiny and analysis of squid logfiles. The program allows a non-technical user to extract information about web usage patterns, the type of information downloaded, the sites visited by users, the graphics downloaded, and the amount of information (per-byte or per-file) accessed. The program runs from a Unix system via a web browser. &lt;br /&gt;
&lt;br /&gt;
===Squid-graph===&lt;br /&gt;
http://squid-graph.securlogic.com/&lt;br /&gt;
&amp;lt;blockquote class=gentoo&amp;gt;&lt;br /&gt;
Package Gentoo: squid-graph&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Squid Graph is a free, simple, yet powerful Squid v2 native logfile analysis tool that generates reports with graphical representation of the proxy server&amp;#039;s traffic.&lt;br /&gt;
&lt;br /&gt;
Cet outil n&amp;#039;analyse le trafic que pour une journée. Sans doute vaut il mieux le faire soit même avec rrdtool.&lt;br /&gt;
&lt;br /&gt;
[[Image:Squidgraph.png|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
Noter l&amp;#039;outil &amp;lt;tt&amp;gt;/usr/bin/timeconv&amp;lt;/tt&amp;gt; qui traduit les dates au format squid.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Proxy POP=&lt;br /&gt;
==perdition==&lt;br /&gt;
==p3scan==&lt;br /&gt;
&amp;lt;blockquote class=gentoo&amp;gt;&lt;br /&gt;
Package Gentoo: p3scan, spamassassin&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rediriger les connexions vers les serveurs POP externes sur le port 8110 du serveur.&lt;br /&gt;
&amp;lt;licode file=/etc/fw/rc.firewall&amp;gt;&lt;br /&gt;
#Redirection des connexion POP du LAN vers les serveurs POP externes le p3scan 8110&lt;br /&gt;
$IPTABLES -t nat -A PREROUTING -p tcp -d ! $IP_LAN -i $IF_LAN --dport pop3 -j REDIRECT --to 8110&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;licode file=/etc/fw/access&amp;gt;&lt;br /&gt;
$IPTABLES -A INPUT  -i $IF_LAN -s $LAN_NET               -p tcp --sport 1024: --dport 8110  -m state --state NEW -j ACCEPT&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configurer p3scan :&lt;br /&gt;
&amp;lt;licode file=/etc/p3scan/p3scan.conf&amp;gt;&lt;br /&gt;
maxchilds = 10&lt;br /&gt;
ip = 192.168.10.1&lt;br /&gt;
user = amavis&lt;br /&gt;
scannertype = basic&lt;br /&gt;
scanner = /usr/bin/clamdscan --no-summary&lt;br /&gt;
 checkspam&lt;br /&gt;
 spamcheck = /usr/bin/spamc&lt;br /&gt;
 quiet&lt;br /&gt;
template = /etc/p3scan/p3scan-fr.mail&lt;br /&gt;
&amp;lt;/licode&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#chown amavis /var/spool/p3scan -R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configuration « antispam » avec spamassassin&lt;br /&gt;
&lt;br /&gt;
Les paramètres de configuration de p3scan.conf sont checkspam et spamcheck.&lt;br /&gt;
&amp;lt;pre&amp;gt;#chown amavis /var/amavis/.spamassassin/bayes_journal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il faut lancer spamd:&lt;br /&gt;
&amp;lt;pre&amp;gt;#/etc/init/spamd start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#/etc/init.d/p3scan start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Remarques :&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
*L&amp;#039;option debug génère de nombreux logs &lt;br /&gt;
*Le user doit correspondre au user de clamd – ici amavis&lt;br /&gt;
*Les virus sont laissés par défaut dans le répertoire /var/spool/p3scan. &lt;br /&gt;
*L&amp;#039;option &amp;lt;tt&amp;gt;justdelete&amp;lt;/tt&amp;gt; supprime le message au lieu de le laisser dans ce répertoire.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Copy|2006|Christophe de Livois|FDL}}&lt;/div&gt;</summary>
		<author><name>Christophe</name></author>
	</entry>
</feed>