当前位置: 首页 >> 应用软件 >> 网络相关 >> SQUID编译安装
 

SQUID编译安装

作者:      来源:     发表时间:2006-05-11     浏览次数:      字号:    

编译安装:
tar zxvf squid-2.5.STABLE9.tar.gz
cd squid-2.5.STABLE9
./configure --prefix=/usr/local/squid \
--enable-arp-acl \
--enable-linux-netfilter \
--enable-pthreads \
--enable-err-language="Simplify_Chinese" \
--enable-default-err-language="Simplify_Chinese" \
--enable-auth="basic" \
--enable-baisc-auth-helpers="NCSA" \
--enable-underscore

/usr/local/squid/sbin/squid -z #建立squid缓存目录
/usr/local/squid/var/cache、/usr/local/squid/var/logs两个目录的属主改为nobody,或者权限设为0777,否则squid不能启动

设置squid支持用户认证:

说明:透明代理和用户认证功能不能同时应用。否则用户认证功能不起作用。
假定squid source目录在/squid-2.5.STABLE9

2. # cd /squid-2.5.STABLE9/helpers/basic_auth/NCSA/
   # make ncsa_auth

3. 拷贝生成的执行文件ncsa_auth到squid执行文件目录
# cp ncsa_auth /usr/local/squid/bin

用户认证配置如下:
auth_param basic program /usr/local/squid/bin/ncsa_auth /usr/local/squid/etc/password
auth_param basic children 10
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 20 hours
acl normal proxy_auth REQUIRED
http_access allow normal
auth_param basic casesensitive off


注意事项:
acl normal proxy_auth REQUIRED语句定义的normal不需要用acl normal src xxx.xxx.xxx.xxx重新定义,系统会默认源IP为0.0.0.0/0,如果normal用acl语句重新定义了,squid启动会报如下错误:aclParseAclLine: ACL 'normal' already exists with different type, skipping.

squid.conf中默认的http_access deny all必须注释,否则用户认证不能成功

某些配置讲解:
cache dir ufs /home/squid/cache 1024 16 256

---- #硬盘缓冲区的大小,大小为1GB,一级目录16个,二级目录256个。

---- cache access log /var/log/squid/access.log

---- #该log文件是用来描述每次客户请求HTTP内容时高速缓存命中或未命中的项目,同时还描述提出请求的主机身份及它们所需要的内容,它是用SQMGRLOG等软件分析记费的基础。

---- cache log /var/log/squid/cache.log

---- #用于描述当Squid守护进程启动时可以看到的内存容量、交换空间的大小、高速缓存目录的位置、所接受的连接类型以及接受连接的端口。

---- cache_store_log /var/log/squid/store.log

---- #用于描述页面从高速缓存中被调入调出的情况。

pid filename /var/run/squid.pid
#Squid进程的进程号。
dns nameservers 192.x.x.1
#定义域名解析服务器的地址。
cache_mgr squidadmin@your.domain
#cache管理员的邮件箱地址。
reference age 1 week
#设置缓冲区的更新周期。
maximum object size 4096 KB
#设置允许被缓存的一次性最大请求。
cache_effective_user squidadmin squidadmin
#以用户squidadmin的身份运行。


参考:http://www.moon-soft.com/download/info/2415.htm
      http://www.cublog.cn/opera/showart.php?blogid=12869&id=66756
      http://www1.stock1818.com/soft/Article.Asp?id=11763
来源:http://www.cublog.cn/u/13764/?u=http://www.cublog.cn/u/13764/showart.php?id=106543
 

编辑 webmaster

 
 
 
评论更多>>
 
 
发表
 
姓名: QQ:
性别: MSN:
E-mail: 主页:
评分: 1 2 3 4 5
评论内容:
验证码:
  
  • 请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
  • 严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论 。
  • 用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表网友个人观点,与本网站立场无关。
  •