博客
关于我
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 | pyupgrade,一个有趣的 Python 库!
    查看>>
    python | pyvips,一个神奇的 图像处理 Python 库
    查看>>
    Python | qutip,一个高级的 Python 库!
    查看>>
    python | rapidjson,一个实用的 提高JSON处理效率 Python 库!
    查看>>
    python | reflex,一个无敌的 Python 库!
    查看>>
    python | reloading,一个强大的 Python 库!
    查看>>
    python | rich,一个无敌的 Python 库!
    查看>>
    python | rlax,一个超强的 强化学习领域 Python 库!
    查看>>
    python | rpyc,一个超实用的 Python 库!
    查看>>
    python | rq,一个无敌的 关于Redis 的Python 库!
    查看>>
    python读取字符串指定位置字符_python要怎么截取指定位置的字符串呢?
    查看>>
    python | scikit-llm,一个神奇的 Python 库!
    查看>>
    python | sentry,一个超酷的 关于错误监控工具 Python 库!
    查看>>
    python | shiv,一个超酷的 打包工具 Python 库!
    查看>>
    python | six,一个神奇的 Python 库!
    查看>>
    Python读取图片的几种方法供net使用
    查看>>
    python | spacy,一个神奇的 Python 库!
    查看>>
    python | sqlmap,一个实用的 Python 库!
    查看>>
    python | sumy,一个超酷的 用于文本摘要的 Python 库!
    查看>>
    python | tiler,一个不可思议的 图像切片重组 Python 库!
    查看>>