Sarg installation configuration tutorial

  
 

The full name of SARG is: Squid Analysis Report GeneratorSARG is a Squid log analysis tool. It uses html format to detail the site information, time occupation information, ranking, connection times, and traffic of each user accessing the internet. , visits, etc.

Install SARG (take sarg-2.3.1. as an example)

wget http://prdownloads.sourceforge.net/sarg/sarg-2.3.1.tar.gztar -zxvf sarg -2.3.1.tar.gzcd sarg-2.3.1

./configuremakemake install

Create SARG Report Directory

mkdir /var/www/html/sarg ## My web root directory is /var/www/html

Set SARG

vi /usr/local/sarg/sarg.conf ##sargInstallation directory

access_log /var/log/squid/access.logoutput_dir /var/www/html/sargresolve_ip yesoverwrite_report yes

Setting up hourly update report data

vi /etc/cron.hourly/sarg

#!/bin/sh

/usr/bin/sarg > /dev/null 2>&1

chmod a+x /etc/cron.hourly/Sarg

Select other related settings

Edit /etc/hosts IP hostname comparison table, for example:

192.168.18.10 Mary192.168.18.11 Jack192.168.18. 12 David...

Set daily 23:59 Clear Proxy Cache

vi /etc/squid/squid.freshcache

#!/bin/sh

/usr/bin/sargsleep 5ssyncservice squid stopsleep 5strue > /var/log/squid/access.logtrue > /var/lo /var/log/squid/store.logtrue > /var/log/squid/squid.outsleep 5ssyncrm -rf /var/spool/squid/*sleep 5ssyncservice squid start

chmod a+x /etc/squid/squid.freshcache

vi /etc/crontab

59 23 * * * root /etc/squid/squid.freshcache

Copyright © Windows knowledge All Rights Reserved