博客
关于我
Squid服务器ACL与日志分析
阅读量:376 次
发布时间:2019-03-04

本文共 1779 字,大约阅读时间需要 5 分钟。

Squid???ACL?????????

Squid????ACL????

Squid??????????????????????????ACL?????????????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 ???
    • ???????????Squid????????????
    • ???????Squid???????????????????
    • ?????deny??????allow???????allow all?deny all?
  • ????

    ???1????????????????

    acl aaa src 192.168.100.0/24http_access deny aaa

    ???2?????????????????

    acl aaa src 192.168.100.0/24acl bbb time MTWHF 08:30-17:30http_access allow aaa bbbhttp_access deny aaa

    ???3?????????????

    acl ccc dst "/tmp/ipblock.list"acl ddd dstdomain "/tmp/dmblock.list"http_access deny ccchttp_access deny ddd

    Squid????

    SARG?Squid Analysis Report Generator??????Squid???????????????????????SARG?????????

    ??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/bashTD=$(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/nullexit 0

    - ?????????   ```bash   chmod +x /usr/local/sarg/daily.sh
    • ?????????
    crontab -e00 00 * * * /usr/local/sarg/daily.sh

    ????

    • ????
      ??Squid?????
      tail -3 /usr/local/squid/var/logs/access.log
    • ????
      ?????????URL???????????

    转载地址:http://hibg.baihongyu.com/

    你可能感兴趣的文章
    python 按照当前日期创建文件
    查看>>
    Python 接口并发测试详解
    查看>>
    Python 接口自动化 —— requests框架
    查看>>
    python 接口自动化数据结构(如列表、字典、元组)
    查看>>
    Python 接口自动化测试中的深拷贝与浅拷贝~
    查看>>
    Python 接口自动化测试中的高阶函数
    查看>>
    python 控制 cmd 命令行颜色
    查看>>
    Python 操作 Azure Blob Storage
    查看>>
    Python 操作 Excel 全攻略 | 包括读取、写入、表格操作、图像输出和字体设置
    查看>>
    Python 操作 JMeter 探索:pymeter 实操指南
    查看>>
    Python 操作 Redis
    查看>>
    Python 操作Mysql(PyMysql)
    查看>>
    Python 操作Redis
    查看>>
    Python 操作sqlite数据库及保存查询numpy类型数据(一)
    查看>>
    Python 操作sqlite数据库及保存查询numpy类型数据(二)
    查看>>
    Python 操作数据库
    查看>>
    Python 数据分析与可视化实战
    查看>>
    python 数据可视化 -- matplotlib02
    查看>>
    python 数据可视化利器
    查看>>
    Python 数据可视化详解
    查看>>