您查看的文章来源于http://www.oklinux.cn
一个功能较全的squi配置文件
#用户认证
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/password
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 1 hours
auth_param basic casesensitive off
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#本网段用户可以上网
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access deny !our_networks
#绑定mac和ip
acl userip src 192.168.1.3
acl usermac arp 00:0C:29:4E:F5:92
http_access deny usermac !userip
http_access deny !usermac userip
http_access allow localhost
#每个人的连接限制为一个
acl onlyone maxconn 2
http_access deny onlyone
#一个用户只能从一个ip登录代理服务器
acl perip max_user_ip -s 1
http_access allow perip