Chinaunix首页 | 论坛 | 博客
  • 博客访问: 147659
  • 博文数量: 50
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 485
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-22 09:19
个人简介

FreeBSD,Postfix,SendMail

文章分类

全部博文(50)

文章存档

2015年(50)

我的朋友

分类: 服务器与存储

2015-01-01 21:21:41

?squid正向配置

http_port 3128
logfile_rotate 3
cache_mem 1024 MB
cache_swap_low  90
cache_swap_high 96
 

acl apache rep_header Server ^Apache

 
 
cache_replacement_policy heap GDSF
cache_dir aufs /opt/squid/cache 4000 16 32
cache_dir aufs /opt/squid/cachedir/cache01 4000 16 32
cache_dir aufs /opt/squid/cachedir/cache02 4000 16 32
cache_log /opt/squid/var/logs/cache.log
 
strip_query_terms off
acl nolog urlpath_regex -i \.dll
#emulate_httpd_log on
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh
cache_access_log /opt/squid/var/logs/access.log combined !nolog
access_log /opt/squid/var/logs/newaccess.log
cache_store_log none
 
ipcache_size 1024
ipcache_low 95
ipcache_high 95
fqdncache_size 1024
 
hierarchy_stoplist \.jsp
acl QUERY urlpath_regex \.jsp
no_cache deny QUERY
 
 
acl cache_object urlpath_regex -i \.jpg$
acl cache_object urlpath_regex -i \.png$
acl cache_object urlpath_regex -i \.htm
acl cache_object urlpath_regex -i \.html
acl cache_object urlpath_regex -i \.gif$
acl cache_object urlpath_regex -i \.swf$
no_cache deny !cache_object
 
acl bmsDomain dstdomain .zhaopin.com
no_cache deny bmsDomain
 
minimum_object_size 0 KB
maximum_object_size 6 MB
maximum_object_size_in_memory 1024 KB
 
memory_replacement_policy heap GDSF
 
ftp_user nothing@yahoo.com
ftp_list_width 256
dns_children 120
redirect_children 20
#authenticate_program /usr/local/squid/bin/ncsa_auth /usr/local/squid/etc/passwd
refresh_pattern         ^ftp:           1440    20%     10080
refresh_pattern         ^gopher:        1440    0%      1440
refresh_pattern         .               0       20%     4320
refresh_pattern        -i \.gif$       180     90%     1440    reload-into-ims ignore-no-cache
refresh_pattern        -i \.jpg$       180     90%     1440    reload-into-ims ignore-no-cache
refresh_pattern -i \.wmv$       1440    90%     2880    reload-into-ims ignore-no-cache
refresh_pattern -i \.flv$       1440    90%     2880    reload-into-ims ignore-no-cache
refresh_pattern -i \.png$       1440    90%     2880    reload-into-ims ignore-no-cache
refresh_pattern -i \.css$       1440    90%     2880    reload-into-ims ignore-no-cache
refresh_pattern -i \.swf$       1440    90%     2880    reload-into-ims ignore-no-cache
 
 
acl all src 0.0.0.0/0.0.0.0 (3.0不要这一行)
acl manager proto cache_object
acl FTP proto FTP
acl specialusers src 192.168.24.14/32
 
acl localhost src 127.0.0.1/255.255.255.255
acl msnmessenger req_mime_type ^application/x-msn-messenger$
acl msn url_regex -i gateway.dll
acl denyport port 3000 4000
acl SSL_ports port 443 563
 
 
acl temp_ports port 5283
acl Safe_ports port 80 443
acl Safe_ports port 8010
acl Safe_ports port 8086
acl Safe_ports port 8001
acl Safe_ports port 8080
acl Safe_ports port 8003
acl Safe_ports port 8000
acl Safe_ports port 8888
acl Safe_ports port 8088
acl Safe_ports port 7004
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 Purge method PURGE
http_access allow Purge localhost
 
acl CONNECT method CONNECT
acl qqserver dst 219.133.0.0/16
acl qqserverd dstdomain .qq.com .tencent.com
acl tianya dstdomain .tianya.cn
acl tianya dstdomain .tianyaclub.com
acl meebo dstdomain .meebo.com
acl meebo dstdomain .meebo.com.cn
acl webqq dstdomain .im.qq.com
acl webqq1 dstdomain .waysonline.net
acl myip src 192.168.2.68/32 192.168.2.113/32
acl kaixin dstdomain .kaixin001.com
acl kxlive dstdomain .kxlive.com
acl kaixin dstdomain .kaixin.com
 
http_access deny tianya
http_access deny meebo
http_access deny kaixin
http_access deny kxlive
http_access deny hahapage
http_access deny webqq
http_access deny webqq1
deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html imhaha
deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html tianya
deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html meebo
deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html kaixin
deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html webqq
acl gamesvr dstdomain .travian.cn .travian.com .travian.hk .travian.china.com
http_access allow gamesvr myip
http_access deny gamesvr
deny_info http://images.zhaopin.com/zhaopin/aboutus/law.html gamesvr
 
acl allow_ip src 192.168.2.0/255.255.255.0
acl allow_ip src 192.168.17.0/24
acl allow_ip src 192.168.19.0/24
acl allow_ip src 192.168.20.0/255.255.255.0
acl allow_ip src 192.168.21.0/255.255.255.0
acl allow_ip src 192.168.22.0/255.255.255.0
acl allow_ip src 192.168.23.0/255.255.255.0
acl allow_ip src 192.168.24.0/255.255.255.0
acl allow_ip src 192.168.25.0/255.255.255.0
acl allow_ip src 192.168.26.0/255.255.255.0
acl allow_ip src 192.168.28.0/255.255.255.0
acl allow_ip src 192.168.27.0/24
acl allow_ip src 192.168.29.0/255.255.255.0
 
 
acl cs_deny_ip src 192.168.21.193/32
 
acl denyurl url_regex -i ^
acl denyurl url_regex -i fastsmuthost.com
acl denyurl url_regex -i webex.com
acl denyurl url_regex -i ^
acl denyurl url_regex -i icq\.
acl imhaha  url_regex -i imhaha.com
#acl denyurl url_regex -i \.qq\.com
#acl denyurl url_regex -i \.tencent\.com
acl denyurlpath urlpath_regex -i \.mp3$
acl denyurlpath urlpath_regex -i \.wma$
acl denyurlpath urlpath_regex -i \.wmv$
acl denyurlpath urlpath_regex -i \.rm$
acl denyurlpath urlpath_regex -i \.exe$
acl denyurlpath urlpath_regex -i \.scr$
acl denyurlpath urlpath_regex -i \.pif$
 
acl music_denyurlpath urlpath_regex -i \.mp3$
acl music_denyurlpath urlpath_regex -i \.wam$
 
acl video_denyurlpath urlpath_regex -i \.wmv$
acl video_denyurlpath urlpath_regex -i \.rm$
 
acl soft_denyurlpath urlpath_regex -i \.exe$
acl soft_denyurlpath urlpath_regex -i \.scr$
acl soft_denyurlpath urlpath_regex -i \.pif$
 
acl worktime time 8:45-12:00
acl worktime time 13:00-18:00
 
 
 
acl qquserlst src "/opt/squid/etc/policy/qquserlst"
acl qqsvrlist dst "/opt/squid/etc/policy/qqsvriplist"
acl qqsvrlist02 dstdomain "/opt/squid/etc/policy/qqsvrdomainlist"
 
acl download5Mb src "/opt/squid/etc/policy/download5Mb"
acl download10Mb src "/opt/squid/etc/policy/download10Mb"
acl download20Mb src "/opt/squid/etc/policy/download20Mb"
acl download40Mb src "/opt/squid/etc/policy/download40Mb"
acl download50Mb src "/opt/squid/etc/policy/download50Mb"
acl download100Mb src "/opt/squid/etc/policy/download100Mb"
acl download200Mb src "/opt/squid/etc/policy/download200Mb"
acl download500Mb src "/opt/squid/etc/policy/download500Mb"
acl downloadexefile src "/opt/squid/etc/policy/downloadexefile"
 
 
acl CONNECTip src "/opt/squid/etc/policy/CONNECTip"
acl music_denyurlpathIP  src "/opt/squid/etc/policy/music_denyurlpath"
acl video_denyurlpathIP  src "/opt/squid/etc/policy/video_denyurlpath"
acl soft_denyurlpathIP  src "/opt/squid/etc/policy/soft_denyurlpath"
acl denyurlIP  src "/opt/squid/etc/policy/denyurlpath"
 
 
reply_body_max_size 5242880 allow download5Mb
reply_body_max_size 10485760 allow download10Mb
reply_body_max_size 20971520 allow download20Mb
reply_body_max_size 52428800 allow download50Mb
reply_body_max_size 104857600 allow download100Mb
reply_body_max_size 209715200 allow download200Mb
reply_body_max_size 524288000 allow download500Mb
reply_body_max_size 41943040 allow download40Mb
reply_body_max_size 5000000 allow specialusers !worktime
 
reply_body_max_size 1048576 allow all
 
http_access deny denyip
http_access allow denyurlpath denyurlIP
http_access allow music_denyurlpath music_denyurlpathIP
http_access allow video_denyurlpath video_denyurlpathIP
http_access allow soft_denyurlpath soft_denyurlpathIP
 
 
http_access allow soft_denyurlpath downloadexefile
http_access allow manager localhost
http_access deny manager
http_access allow CONNECT qquserlst qqsvrlist qqsvrlist02
http_access allow CONNECT CONNECTip
http_access allow CONNECT it-harvey
http_access deny CONNECT qqserverd
http_access deny CONNECT qqserver
http_access deny CONNECT qqsvrlist
http_access deny CONNECT qqsvrlist qqsvrlist02
http_access allow FTP myip
http_access deny FTP
http_access allow temp_ports
http_access deny denyport
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny icqip
http_access deny denyurl
http_access deny denyurlpath
http_access deny cs_deny_ip msnmessenger
http_access deny cs_deny_ip msn
http_access allow allow_ip
http_access allow allow_ip msnmessenger
http_access deny all
icp_access allow all
miss_access allow all
proxy_auth_realm zp_admin
 
 
cache_mgr admin@zhaopin.com.cn
cache_effective_user squid
cache_effective_group squid
visible_hostname squid-test
 
 
snmp_port 3401
acl Snmppublic snmp_community public
acl Adminhost src 192.168.2.158
snmp_access allow Adminhost Snmppublic
 
 
/opt/squid/sbin/squid -v
'--prefix=/opt/squid' '--enable-async-io=40' '--enable-storeio=aufs,coss,diskd,ufs' '--enable-useragent-log' '--enable-referer-log' '--enable-kill-parent-hack' '--enable-forward-log' '--enable-snmp' '--enable-cache-digests' '--enable-default-err-language=Simplify_Chinese' '--enable-epoll' '--enable-removal-policies=heap,lru' '--enable-large-cache-files' '--disable-internal-dns' '--enable-x-accelerator-vary' '--enable-follow-x-forwarded-for' '--with-large-files' '--disable-ident-lookups' '--enable-underscore' '--disable-arp-acl' '--with-maxfd=65500'
阅读(410) | 评论(0) | 转发(0) |
0

上一篇:访问控制

下一篇:51-android.rules

给主人留下些什么吧!~~