squid

更新时间:2023-04-19 10:29:35 阅读: 评论:0


2023年4月19日发(作者:广州市皮防所)squid的安装⽅法

⼀.安装说明
1.版本信息:Squid Cache: Version 13
2.配置信息:
configure options: '--prefix=/usr/local/squid' '--enable-gnuregex'
'--enable-async-io=80' '--enable-icmp' '--enable-kill-parent-hack'
'--enable-snmp' '--disable-ident-lookups' '--enable-cahce-digests'
'--enable-err-language=Simplify_Chine'
'--enable-default-err-languages=Simplify_Chine'
'--enable-poll' '--enable-linux-netfilter' '--enable-underscore'
'--enable-arp-acl'
3.对cache⽬录进⾏初始化
#/usr/local/squid/sbin/squid –z
4.⽤户认证
⽤户/密码认证为Squid管理提供了更多便利,最常⽤的认证⽅式是NCSANCSA认证包含在了basic中,⽽⾮以前单独的认证
模块。实现认证的具体操作:
“make install”以后,需要将“helpers/basic_auth/NCSA/ncsa_auth”拷贝到⽤户可执⾏⽬录中/usr/bin
(如果在该⽬录中找不到这个执⾏⽂件,在编译时请使⽤make all⽽不是make,或者直接在该⽬录中执⾏make),然后需要
借助Apache的密码管理程序htpasswd来⽣成⽤户名/密码对应的⽂件,就像下⾯这⾏代码:
htpasswd -c /var/squid/etc/password guest
在输⼊两遍guest⽤户的密码后,⼀个guest⽤户就⽣成了。如果以后需要添加⽤户,把上⾯的命令去掉-c参数再运⾏即
可。
⼆.管理、使⽤说明
(⼀高中英语演讲稿 )服务管理
1SQUID根⽬录
/usr/local/squid/
2.启动SQUID服务
#/usr/loca/squid/bin/RunCache &
3.停⽌SQUID服务
#/usr/local/squid/sbin/squid -k shutdown
(需要运⾏两次)
4configure file
/usr/local/squid/etc/

重新加载配置⽂件:
#/usr/local/squid/sbin/squid –k reconfigure
(需要运⾏两次)
(⼆)⽤户管理
1.账户⽂件
/usr/local/squid/etc/password
2.初始添加⽤户
#htpasswd -c /usr/local/squid/etc/password urname
3.添加⽤户
#htpasswd /usr/local/squid/etc/password urname
(三)权限管理
1MAC地址列表
acl DONGLE arp 00:07:E9:56:08:F5
acl WANGMENGYI arp 00:07:E9:74:BF:DB
acl WANGJING arp 00:07:E9:84:93:FF
acl LIDUAN arp 00:16:96:0C:D4:6F
acl YUWENHUA arp 00:07:E9:74:B7:83
acl LURUIJUAN arp 00:16:96:0C:E2:43
acl JINJUFANG arp 00:07:E9:84:8F:9C
acl YANGRUI arp 00:07:E9:55:FD:E6
acl LIXINYING arp 00:07:E9:84:真棒英文 B1:3E
acl ZHOUWEI arp 00:0D:61:9C:84:B6
acl PUBLIC_ INTERNET arp 00:0D:61:97:04:F9
acl bp_auth proxy_auth REQUIRED
acl white_list dstdomain "/usr/local/squid/etc/white_list"




2.⽤户访问控制列表
<1>修改中的认证⽅式,配置需要使⽤到的相关功能。
#指定password⽂件位置
auth_param basic program /usr/bin/ncsa_auth /usr/local/squid/etc/password

#指定认证程序的进程数
auth_param basic children 5
auth打土豪 _param basic realm Squid proxy-caching web rver
auth_param basic credentialsttl 2 hours
auth_param basic cansitive off


<2>MAC地址限制相应主机需经过认证后可以访问’white_list’中的站点。
http_access allow DONGLE bp_auth white_list
http_access allow WANGMENGYI bp_auth white_list
http_access allow WANGJING bp_auth white_list
http_access allow LIDUAN bp_auth white_list
http_access allow YUWENHUA bp_auth white_list
http_access allow LURUIJUAN bp_auth white_list
http_access allow JINJUFANG bp_auth white_list
http_access allow YANGRUI bp_auth white_list
http_access allow LIXINYING bp_auth white_list
http_access allow ZHOUWEI bp电怎么组词 _auth white_list
http_access allow PUBLIC_INTERNET bp_auth white_list
3white-list如下
/usr/local/squid/etc/果树种植方法 white_list




.
.
.
.
.
.

(四)⽇志管理
1log⽬录

usr/local/squid/var/logs/
2crontab每⽇更新log⽂件
00 1 * * * /usr/local/squid/var/squid_log_
3squid_log_脚本
/usr/local/squid/etc/squid_log_
#!/bin/sh
cd /usr/local/squid/var/logs/
t -e

yesterday_cs=`perl -e 'print time -43200'`
yesterday_date=`date -r +%Y%m%d`

# rename the current log file without interrupting the logging process
mv .$yesterday_

# tell Squid to clo the current logs and open new ones
/usr/local/squid/sbin/squid -k rotate

4.修改log格式
#logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %
#liqidong
logformat squid %tl %>a %un %rm %ru

1. >a 客户端的IP地址
2. >A 客户端的正式域名
3. >p 客户端的端⼝号
4.
5. la 本地IP 地址(http_port
6. lp 本地端⼝号(http_port
7. ts Seconds since epoch从新纪元到现在的秒数
8. tu subcond time (milliconds)
9. tl 本地时间,缺省是:⽇//年:⼩时:分:秒 时区
10. tg 格林尼治标准时间,缺省是:⽇//年:⼩时:分:秒 时区
11. tr Respon time (milliconds)响应时间(毫秒)
12. >h Request header. Optional header name argument on the format header[:[parator]elem肠仔包 ent]

13. h
14. un Ur name⽤户名
15. ul Ur login
16. ui Ur ident
17. us Ur SSL⽤户使⽤的SSL
18. ue Ur external acl⽤户外部的acl
19. Hs HTTP status code
20. Ss Squid request status (TCP_MISS etc)
21. Sh Squid hierarchy status (DEFAULT_PARENT etc)
22. mt MIME content type
23. rm Request method (GET/POST e外国诗人 t缓慢近义词 c) 请求的⽅法
24. ru Request URL请求的URL
25. rv Request protocol version请求的协议版本
26. ea Log string returned by external acl 外部acl返回的log字符串
27.
28. >st Request size including HTTP headers
29. st Request+Reply size including HTTP headers
30. % a literal % character


# >a Client source IP address
# >A Client FQDN
# >p Client source port
#

# la Local IP address (http_port)
# lp Local port number (http_port)
# ts Seconds since epoch
# tu subcond time (milliconds)
# tl Local time. Optional strftime format argument
# default %d/%b/%Y:%H:%M:%S %豆腐炖什么好吃 z
# tg GMT time. Optional strftime format argument
# default %d/%b/%Y:%H:%M:%S %z
# tr Respon time (milliconds)
# >h Request header. Optional header name argument
# on the format header[:[parator]element]

#
# as for >h
# un Ur name
# ul Ur login
# ui Ur ident
# us Ur SSL
# ue 自主实习申请 Ur external acl
# Hs HTTP status code
# Ss Squid request status (TCP_MISS etc)
# Sh Squid hierarchy status (DEFAULT_PARENT etc)
# mt MIME content type
# rm Request method (GET/POST etc)
# ru Request URL
# rv Request protocol version
# ea Log string returned by external acl
#
# >st Request size including HTTP headers
# st Request+Reply size including HTTP headers
# % a literal % character


本文发布于:2023-04-19 10:29:35,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/836983.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

下一篇:四巧板
标签:squid
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图