squid文档配置说明(中文)

http_port 8080 配置http代理端口为8080

cache_peer pa.us.ircache.net sibling 3128 3130 login=*:*

cache_peer sj.us.ircache.net sibling 3128 3130 login=*:*

cache_peer * parent 13280 4827 htcp *:*

这几行是使用squid能够和其他几台机器进行协同工作的特性,同几台组成cache_peer。具体配置在后面的优化部分会解释。

cache_peer_domain * .edu.cn配置.edu.cn的域名使用某个cache_peer访问

cache_mem 400 MB设定内存cache的大小为400M

cache_swap_low 80

cache_swap_high 97这两行是配置cache进行替换的闸值。当占用到97%的cache后,cache中的内容将被清空20%。

maximum_object_size 20000 KB 最大对象大小为20M.

maximum_object_size_in_memory 10000 KB 内存中最大的对象大小为10M

ipcache_size 4096 ip对应cache的大小为4096

fqdncache_size 4096 域名全称cache的大小为4096

cache_replacement_policy heap LFUDA cache替换策略

memory_replacement_policy heap LRU 内存替换策略

cache_dir ufs /usr/local/squid/cache 25000 16 256 cache存放的路径大小及具体配置

dns_nameservers * * * * * 内部指定dns服务器

authenticate_program * * 身份认证程式

authenticate_children 32 身份认证程式启动的进程数目

request_body_max_size 5 MB 最大请求的body大小

reply_body_max_size 20 MB 最大回应的body大小

acl all src 0.0.0.0/0.0.0.0

acl dorm proxy_auth 192.168.0.0/255.255.0.0 REQUIRED

acl bjpu proxy_auth 202.112.64.0/255.255.240.0 REQUIRED

acl bjpu2 proxy_auth 211.71.80.0/255.255.240.0 REQUIRED

访问控制列表

acl banned_sites

http_access deny banned_sites

deny_info ERR_BANNED_SITE banned_sites

禁止访问违禁站点的配置

acl manager proto cache_object

acl localhost src 127.0.0.1/255.255.255.255

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, snews

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 dorm

http_access allow bjpu

http_access allow bjpu2

http_access allow manager localhost

http_access deny manager

http_access deny !Safe_ports

http_access deny CONNECT !SSL_ports

http_access deny all

允许http访问

icp_access allow *允许cache_peer使用ICP协议访问

proxy_auth_realm BJPU proxy-caching web server 验证框提示的banner

cache_mgr liukange@netease.com cache管理员的电子邮件地址

cache_effective_user *

cache_effective_group * 执行cache程式的用户uid和gid

visible_hostname cnproxy.bjpu.edu.cn cache服务的机器名

memory_pools on 内存池配置为打开。

memory_pools_limit 50 MB 内存池的大小

Socks5代理的安装

出国代理上选用的socks5代理软件是NEC公司制作的软件。他实际上是个商业版软件。但是根据他的license文档所述,在非商业用途上使用这个软件是免费的。在

RFC-1928对socks5如何运行做了周详的描述。这个标准就是NEC公司的“Ying-Da Lee”和HP及IBM公司定制的。在相应的测试中,NEC公司的这个socks5代理软件的性

能是较好的。虽然他有一些安全上的漏洞,但是使用freebsd的ports方式安装,将会自动对源代码打补丁,修正安全隐患。

在/usr/ports/net/socks5下执行make;make install就能安装好该程式。相应的文档将被安装在下列目录:

socks5可执行文档被放在/usr/local/bin

socks5.conf文档被放在/usr/local/etc下

bugtraq上曾提到socks5的密码验证部分有安全隐患,因此没有使用该功能。

Socks5代理的配置

Socks5代理的配置文档是socks5.conf,内容如下:

set SOCKS5_MAXCHILD 8000

permit - - 192.168. - (1024,65535) -

permit - - 202.112.64.0/255.255.240.0 - (1024,65535) -

permit - - 211.71.80.0/255.255.240.0 - (1024,65535) –

限制工大能够使用该socks5代理,限制目标端口为1024-65535。配置最多能够有8000个进程运行。

配置文档的转换

为了避免带宽的浪费,出国代理配置为夜间取消最大下载对象限制。这是是使用crontab来做到的。每天夜间23:30将配置文档转换为没有最大下载对象限制的。每天上

午7:30转换回有最大下载对象限制的。


文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!