免费注册 查看新帖 |

Chinaunix

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

[proxy] squid 2.6(正向透明代理)保证正确希望能加精 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-24 14:21 |只看该作者 |倒序浏览
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -s 192.168.0.0/16 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -d 0.0.0.0/0 -j MASQUERADE

tar xzvf squid-2.6.STABLE6.tar.gz
cd squid-2.6.STABLE6
./configure --prefix=/usr/local/squid --enable-dlmalloc --with-pthreads --enable-poll --disable-internal-dns --enable-stacktrace --enable-removal-policies="heap,lru" --enable-delay-pools --enable-storeio="aufs,coss,diskd,ufs"
make
make install

修改squid.conf
hierarchy_stoplist -i ^https:\\ ?
acl QUERY urlpath_regex -i cgi-bin \? \.asp \.php \.jsp \.cgi
acl denyssl urlpath_regex -i ^https:\\
no_cache deny QUERY
no_cache deny denyssl
maximum_object_size 20000 KB
maximum_object_size_in_memory 4096 KB

ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024
cache_access_log /var/squid/logs/access.log
cache_log /var/squid/logs/cache.log
cache_store_log none
emulate_httpd_log on
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh

ftp_user Squid@
ftp_passive on

refresh_pattern ^ftp:      1440   20%   10080
refresh_pattern ^gopher:   1440   0%   1440
refresh_pattern .      0   20%   4320
coredump_dir /var/squid/cache

logfile_rotate 90
cache_dir ufs /var/squid/cache 4096 16 256
cache_mem 256 MB
cache_swap_low 80
cache_swap_high 95
cache_effective_user squid
cache_effective_group squid
http_port 3128 transparent
#acl tianya referer_regex -i tianya
#http_access deny tianya
#deny_info tianya
acl AntiBaidu req_header User-Agent Baiduspider
http_access deny AntiBaidu
acl Manager proto cache_object
acl Localhost src 127.0.0.1 192.168.104.1
http_access allow Manager Localhost
http_access deny Manager
acl Safe_ports port 80 # http
acl Safe_ports port 443
http_access deny !Safe_ports
acl all src 0.0.0.0/0.0.0.0
http_access allow all
visible_hostname www.test137.com
cache_mgr dli@99bill.com
cache_effective_user squid
cache_effective_group squid
tcp_recv_bufsize 65535 bytes
error_directory /usr/local/squid/share/errors/Simplify_Chinese
icp_port 0

第一次发自己整理得文档,希望版主能加精。谢谢

论坛徽章:
0
2 [报告]
发表于 2007-02-25 09:52 |只看该作者
顶一下,鼓励
希望能把相关图解,squid.conf配置说明写完整

论坛徽章:
0
3 [报告]
发表于 2007-03-08 10:19 |只看该作者
cache_effective_user squid
cache_effective_group squid

重复

这里是2.5的规范
no_cache deny QUERY
no_cache deny denyssl

2.6版应该写成
cache deny QUERY
cache deny denyssl



cache_access_log /var/squid/logs/access.log

在2.6中应该是
access_log 目录
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP