linux 下squid文件配置说明

squid文件配置说明(中文)

http_port 8080 设置http代理端口为8080 cache_peer blog.mydomain.com sibling 3128 3130 login=*:* cache_peer bbs.mydomain.com sibling 3128 3130 login=*:* cache_peer * parent 13280 4827 htcp *:*

 

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

cache_peer_domain * .mydomain.com设置.mydomain.com的域名使用某个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 [email protected] cache管理员的电子邮件地址 cache_effective_user * cache_effective_group * 执行cache程序的用户uid和gid visible_hostname cnproxy.mydomain.com cache服务的机器名 memory_pools on 内存池设置为打开。 memory_pools_limit 50 MB 内存池的大小

 

 

你可能感兴趣的:(linux,cache,object,manager,Access,DNS服务器)