本文共 1798 字,大约阅读时间需要 5 分钟。
Squid??????????????????????????ACL?????????????ACL???????????????????????????????????????????????
????????
ACL????????acl ???? ???? ????
src??????dst???????port?????domain???????time??????maxconn????????url_regex?URL????????urlpath_regex?URL??????????????
??http_access??????ACL?????? http_access allow ???http_access deny ???
deny??????allow???????allow all?deny all?acl aaa src 192.168.100.0/24http_access deny aaa
acl aaa src 192.168.100.0/24acl bbb time MTWHF 08:30-17:30http_access allow aaa bbbhttp_access deny aaa
acl ccc dst "/tmp/ipblock.list"acl ddd dstdomain "/tmp/dmblock.list"http_access deny ccchttp_access deny ddd
SARG?Squid Analysis Report Generator??????Squid???????????????????????SARG?????????
??GD?
??YUM???yum -y install gd gd-devel
??SARG
- ????? tar zxvf sarg-2.3.7.tar.gz
- ?????
./configure --prefix=/usr/local/sarg --sysconfdir=/etc/sarg --enable-extraprotectionmakemake install
- ??????
echo "access_log /usr/local/squid/var/logs/access.log" > /etc/sarg/sarg.confecho "title \"Squid User Access Reports\"" >> /etc/sarg/sarg.confecho "output_dir /var/www/html/sarg" >> /etc/sarg/sarg.conf
??SARG
sarg
???????
#!/bin/bash TD=$(date +%d/%M/%Y) YETD=$(date -d '1 day ago' +%d/%M/%Y) /usr/local/sarg/bin/sarg --log /usr/local/squid/var/logs/access.log --output /var/www/html/sarg --zone --daily $YETD-$TD > /dev/null exit 0
- ????????? ```bash chmod +x /usr/local/sarg/daily.sh
crontab -e00 00 * * * /usr/local/sarg/daily.sh
tail -3 /usr/local/squid/var/logs/access.log
转载地址:http://hibg.baihongyu.com/