Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1145881
  • 博文数量: 341
  • 博客积分: 12744
  • 博客等级: 上将
  • 技术积分: 4040
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-12 09:34
文章分类
文章存档

2014年(1)

2013年(10)

2012年(17)

2011年(63)

2010年(102)

2009年(107)

2008年(41)

分类: BSD

2009-02-28 19:02:45

最近拿到一台机器,装了个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"生成。
阅读(941) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~