Single

devops-构建Squid代理服务器(2)配置日志分析

+++++++++++配置透Squid日志分析系统+++++++++++

[root@localhost ~]#yum -y install gd gd-devel
[root@localhost ~]#tar -zxvf sarg-2.3.7.tar.gz -C /usr/src/
[root@localhost ~]#cd /usr/src/sarg-2.3.7/
[root@localhost sarg-2.3.7]#./configure 
--prefix=/usr/local/sarg 
--sysconfdir=/etc/sarg 
--enable-extraprotection
[root@localhost sarg-2.3.7]#make && make install
[root@localhost ~]# vim /etc/sarg/sarg.conf
添加:
access_log /usr/local/squid/var/logs/access.log 
title "Squid User Access Reports"
output_dir /var/www/html/sarg
user_ip no
topuser_sort_field BYTES reverse
user_sort_field BYTES reverse
exclude_hosts /usr/local/sarg/noreport
overwrite_report no
mail_utility mail.postfix
charset UTF-8
weekdays 0-6
hours 7-12,14,16,18-20
www_document_root /var/www/html
[root@localhost ~]# service httpd restart
客户端:
[root@localhost ~]# firefox http://192.168.1.1/sarg &

文章有(1)条网友点评

发表评论