最近拿到一台机器,装了个freebsd就搞了一下squid。
配置文件如下:
http_port 3127
debug_options ALL,1
visible_hostname xx.xx.xx
cache_mgr root@xx.xx.xx
acl all src 0.0.0.0/0.0.0.0
cache_mem 32000000
cache_dir ufs /cache 100 16 256
#http_access allow all
#icp_access allow all
dns_testnames internic.net usc.edu cs.colorado.edu mit.edu yale.edu
cache_effective_user nobody nogroup
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 server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users
可以用apache的htpasswd设置用户名密码
htpasswd -c /usr/local/squid/etc/password test
增加一个用户test
其中,ncsa_auth可以编译时加入-enable-basic-auth-helpers="NCSA"生成。
阅读(974) | 评论(0) | 转发(0) |