Utilizzo squid3 come frontend ai miei siti web. Il server web e’ ovviamente apache2. La gestione delle statistiche e’ affidata a awstats.
Per fare in modo che awstats registri correttamente le statistiche , e’ importante modificare il file apache2.conf in modo da sostituire nelle righe di log l’host fornito da apache2 con l’informazione inviata da squid per indicare la presenza di un proxy:
X-Forwarded-For
in pratica nelle tre righe di LogFormat dove e’ presente il parametro %h va messo %{X-Forwarded-For}i
LogFormat “%v:%p mkdir %{X-Forwarded-For}i %l %u %t \”%r\” %>s %O \”%{Referer}i\” \”%{User-Agent}i\”" vhost_combined
LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %O \”%{Referer}i\” \”%{User-Agent}i\”" combined
LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %O” common
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent
fonte: apache2.conf