免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2597 | 回复: 0
打印 上一主题 下一主题

[proxy] squid13+AS4做proxy配置全攻略 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-11 10:31 |只看该作者 |倒序浏览
1,准备工作:
squid-2.6.STABLE13.tar.gz以及httpd-2.2.2.tar.gz和AS4;
配置好静态路由;
2,安装squid以及httpd
安装squid:
tar -zxvf squid-2.6.STABLE13.tar.gz
cd squid-2.6.STABLE13
./configure --prefix=/usr/local/squid
make all
make install

安装认证模块:
cd /home/zhq/helpers/squid-2.6.STABLE13/basic_auth/NCSA
make
make install

安装apache:
tar -zxvf httpd-2.2.2.tar.gz
cd httpd-2.2.2
./configure --prefix=/usr/local/apache
make
make install
   
3,配置squid.conf
http_port 8080 #此处为端口配置;
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_dir ufs /home/squid/cache 1000 16 256
access_log /home/squid/logs/access.log squid
cache_log /home/squid/logs/cache.log
cache_store_log /home/squid/logs/store.log
auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/squidpasswd #此处为用ncsa_auth这种认证方式,在/etc/squid/squidpasswd里面读取认证信息;
auth_param basic children 5 #此处为说明有5个子进程;
auth_param basic realm proxy1.****.edu.cn #此处声明可以填写proxy2.****.edu.cn来取代IP,但不用在DNS里配置;
auth_param basic credentialsttl 2 hours #此处声明2小时后过期,要重新认证;
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 auth_user proxy_auth REQUIRED
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443 563     # 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 auth_user
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow all
cache_effective_user squid
visible_hostname proxy1.****.edu.cn

4,说明:
squid启动:/usr/loca/squid/sbin/squid
若要自启动,加入:/etc/rc.local
加认证用户:/usr/local/apache/bin/htpasswd /usr/local/squid/etc/sqidpasswd zhq
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP