Ads 468x60px

Sunday, November 13, 2011

0
squid.conf by Gien Agena


########################################
# WELCOME TO SQUID LUSCA_HEAD-r14733   #
# Tunning by : GienAgena          #
########################################
cache_mgr GienAgena
#offline_mode on
#============================================================================================================================#
#=========================================================#  AWAL  #=========================================================#
#============================================================================================================================#
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 192.168.2.0/27     # <<< Edit IP Address untuk Local area anda dan mask bits nya
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # 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 manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access deny all
icp_access allow localnet
icp_access deny all
http_port 3128 transparent
cache_dir aufs /cache1/ 81920 16 256  # <<< Edit Maksimal Cache nya "81920" maksudnya kita akan nge cache di direktory cache1 sampe 80GB
cache_mem 8 MB      # <<< Edit untuk cache yang di simpan di memory jangan terlau besar tergantung Jumlah memory ( RAM )
maximum_object_size_in_memory 1 MB   # <<< Edit untuk maksimal object yang di simpan di memory " sesuaikan dengan kebutuhan dan jumlah RAM
minimum_object_size 1 bytes
maximum_object_size 38000 KB    # <<< Edit untuk maksimal besarnya ukuran file yang akan di cache ( sesuaikan dengan kebutuhan )
cache_swap_low 98
cache_swap_high 99
access_log /cache1/access.log
cache_log /cache1/cache.log
cache_store_log /cache1/store.log
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_effective_user squid
cache_effective_group squid

#=================================================================================================================================#
#=========================================================#  REGEX URL  #=========================================================#
#=================================================================================================================================#
coredump_dir /cache1/
###############################################################################
#acl PHP77 url_regex forum.php forumdisplay.php showthread.php showthreads.php
#acl PHP77 url_regex download.php downloads.php classifieds.php classified.php
#acl PHP77 url_regex forum
#no_cache deny PHP77

#hierarchy_stoplist cgi-bin ? localhost
#acl QUERY22 urlpath_regex cgi-bin \? localhost
#no_cache deny QUERY22
################################################################################
#acl store_rewrite_list urlpath_regex \/(get_video|videoplayback\?id|videoplayback.*id) \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|swf)
#acl store_rewrite_list_domain url_regex ^http:\/\/([a-zA-Z-]+[0-9-]+)\.[A-Za-z]*\.[A-Za-z]*
#acl store_rewrite_list_domain url_regex (([a-z]{1,2}[0-9]{1,3})|([0-9]{1,3}[a-z]{1,2}))\.[a-z]*[0-9]?\.[a-z]{3}
#acl store_rewrite_list_path urlpath_regex \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|avc|zip|mp3|3gp|rar|on2|mar|exe)$
#acl store_rewrite_list_domain_CDN url_regex \.rapidshare\.com.*\/[0-9]*\/.*\/[^\/]* ^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*) \.doubleclick\.net.* yieldmanager cpxinteractive ^http:\/\/[.a-z0-9]*\.photobucket\.com.*\.[a-z]{3}$ quantserve\.com

emulate_httpd_log off
server_http11 on
redirector_bypass on

acl video urlpath_regex                   \/(get_video|videoplayback\?id|videoplayback.*id)
acl speedtest urlpath_regex               \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|txt)\?
acl angka1 url_regex                      ^http:\/\/([a-zA-Z-]+[0-9-]+)\.[A-Za-z]*\.[A-Za-z]*
acl angka2 url_regex                      (([a-z]{1,2}[0-9]{1,3})|([0-9]{1,3}[a-z]{1,2}))\.[a-z]*[0-9]?\.[a-z]{3}
acl gambar urlpath_regex                  \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|avc|zip|mp3|3gp|rar|on2|mar|exe)$
acl rapidshare url_regex                  \.rapidshare\.com.*\/[0-9]*\/.*\/[^\/]* ^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*) \.doubleclick\.net.*
acl photobucket url_regex                 ^http:\/\/[.a-z0-9]*\.photobucket\.com.*\.[a-z]{3}$ quantserve\.com
acl google url_regex                      ^http:\/\/[a-z]+[0-9]\.google\.co(m|\.id)
acl indowebster url_regex                 ^http:\/\/\.www[0-9][0-9]\.indowebster\.com\/(.*)(rar|zip|flv|wm(a|v)|3gp|mp(4|3)|exe|msi|avi|(mp(e?g|a|e|1|2|3|4))|cab|exe)
acl getmethod method GET

storeurl_access allow video
storeurl_access allow speedtest
storeurl_access allow gambar
storeurl_access allow rapidshare
storeurl_access allow photobucket
storeurl_access allow indowebster
storeurl_access deny all

storeurl_rewrite_program /usr/local/squid/etc/storeurl.pl
storeurl_rewrite_children 4
storeurl_rewrite_concurrency 20


#=======================================================================================================================================#
#=========================================================#  REFRESH PATTERN  #=========================================================#
#=======================================================================================================================================#
# VIDEO CACHE
refresh_pattern ^http://(.*?)/get_video\? 10080 90% 432000 override-expire ignore-no-cache ignore-private
refresh_pattern ^http://(.*?)/videoplayback\? 10080 90% 432000 override-expire ignore-no-cache ignore-private
refresh_pattern -i (get_video\?|videoplayback\?id|videoplayback.*id) 161280 50000% 525948 override-expire ignore-reload

# facebook
refresh_pattern ((facebook.com)|(85.131.151.39)).*\.(jpg|png|gif) 129600 100% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern ((tagged.com)|(96.17.109.27)).*\.(jpg|png|gif) 129600 100% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern static\.ak\.fbcdn\.net*\.(jpg|gif|png) 129600 100% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern ^http:\/\/profile\.ak\.fbcdn.net*\.(jpg|gif|png) 129600 100% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern edgecastcdn.\net.*\.swf? 129600 100% 129600 override-expire ignore-reload store-stale
refresh_pattern \.(jp(e?g|e|2)|tiff?|bmp|gif|png)($|&) 129600 100% 129600 ignore-no-cache ignore-no-store reload-into-ims override-expire store-stale
refresh_pattern .zynga.net.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale
refresh_pattern .zynga.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale
refresh_pattern .farmville.net.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale
refresh_pattern .farmville.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale
refresh_pattern .ninjasaga.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale
refresh_pattern .apps.facebook.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale
refresh_pattern .frontierville.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale
refresh_pattern .tagged.*\.(jpg|gif|png|swf|mp3)($|&) 129600 100% 129600 store-stale

#ads
refresh_pattern ^.*(utm\.gif|ads\?|rmxads\.com|ad\.z5x\.net|bh\.contextweb\.com|bstats\.adbrite\.com|a1\.interclick\.com|ad\.trafficmp\.com|ads\.cubics\.com|ad\.xtendmedia\.com|\.googlesyndication\.com|advertising\.com|yieldmanager|game-advertising\.com|pixel\.quantserve\.com|adperium\.com|doubleclick\.net|adserving\.cpxinteractive\.com|syndication\.com|media.fastclick.net).* 129600 20% 129600 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth store-stale negative-ttl=40320 max-stale=1440
#specific sites
refresh_pattern ^.*safebrowsing.*google 129600 100% 129600 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth negative-ttl=10080 store-stale
refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?) 129600 99100% 129600 override-expire ignore-reload store-stale
refresh_pattern \.(ico|video-stats) 129600 100% 129600 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod negative-ttl=10080 store-stale

# pictures & images
refresh_pattern -i \.(gif|png|jpeg|jpg|bmp|tif|tiff|ico|swf)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private store-stale
refresh_pattern -i \.(gif|png|jpeg|jpg|bmp|tif|tiff|ico|swf)\? 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private store-stale

# website
#refresh_pattern -i \.(xml|html|htm|js|jsp|txt|css|php|asp)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth store-stale
refresh_pattern -i \.(xml|js|jsp|txt|css)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth store-stale
refresh_pattern -i \.(xml|js|jsp|txt|css)\? 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth store-stale

#sound, video multimedia
refresh_pattern -i \.(flv|x-flv|mov|avi|qt|mpg|mpeg|wmv)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache store-stale
refresh_pattern -i \.(wav|mp3|mp4|au|mid)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private store-stale

# files
refresh_pattern -i \.(iso|deb|rpm|zip|tar|tgz|ram|rar|bin|ppt|doc)$ 10080 90% 43200 ignore-no-cache ignore-auth store-stale
refresh_pattern -i \.(zip|gz|arj|lha|lzh)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth store-stale
refresh_pattern -i \.(rar|tgz|tar|exe|bin)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth ignore-reload ignore-no-cache store-stale
refresh_pattern -i \.(hqx|pdf|rtf|doc|swf)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth store-stale
refresh_pattern -i \.(inc|cab|ad|txt|dll)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth store-stale

#IIX DOWNLOAD
refresh_pattern ^http:\/\/\.www[0-9][0-9]\.indowebster\.com\/(.*)(mp3|rar|zip|flv|wmv|3gp|mp(4|3)|exe|msi|zip) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale ignore-auth

#default option
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern -i (/cgi-bin/|\?) 1 0% 2
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320 store-stale


#=============================================================================================================================#
#=========================================================#  TOOLS  #=========================================================#
#=============================================================================================================================#
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
negative_ttl 2 minutes
half_closed_clients off

connect_timeout 1 minute
read_timeout 15 minutes
request_timeout 5 minutes
persistent_request_timeout 2 minutes
half_closed_clients on
shutdown_lifetime 30 seconds


icp_port 0
prefer_direct off

ipcache_size 5120
ipcache_low 98
ipcache_high 99

fqdncache_size 5120

memory_pools off
log_icp_queries off
icp_hit_stale on
query_icmp on
reload_into_ims on
pipeline_prefetch on
vary_ignore_expire on

#=============================================================================================================================#
#===================================================#     DELAY POOLS     #===================================================#
#=============================================================================================================================#
acl client src 192.168.2.0/27  # <<< Edit IP address sesuaikan dengan IP Local area dan edit Mask Bit nya sesuai dengan kebutuhan

acl ekstensiblok url_regex -i \.aif \.rmi \.snd \.wav \.aifc \.aiff \.au \.mid \.midi \.mp3 \.wma \.aaf \.ogg \.rm
acl ekstensiblok url_regex -i \.asf \x-flv \.mpe \.mpeg \.mpg \.mpv2 \.avi \.m1v \.mp2v \.mpa \.flv \.wmv \.dat
acl ekstensiblok url_regex -i \.mkv \.div \.divx \.div \.ac3 \.dts \.vob \.dvr-ms \.mp4 \.m2v \.m4v \.m2ts \.bup \.rmvb
acl ekstensiblok url_regex -i \.3gpp \.3gp2 \.3gp \.3g2 \.vro \.rm \.ram \.raw \.qt \.mov \.svcd \.xdiv \.3mm \.aep \.des
acl ekstensiblok url_regex -i \.ajp \.amv \.avs \.d2v \.d3v \.dmb \.dxr \.amx \.arf \.asf \.dvx \.f4v \.dv \.bsf \.rv \.msi
acl ekstensiblok url_regex -i \.srf \.hdf \.wbmp \.x3f \.xbm \.cr2 \.crw \.dcr \.tga \.djvu \.emf \.fpx \.icl \.icn \.plp \.vdf
acl ekstensiblok url_regex -i \.ppm \.raf \.ras \.raw \.mrw \.nef \.orf \.pbm \.pcd \.pef \.pgm \.rs \.pdf \.utx \.nzp \.pak \.cdiff
acl ekstensiblok url_regex -i \.rpm \.bin \.dmg \.exe \.msi \.cab \.swf \.wsf \.pdf \.m4v \.000 \.001 \.002 \.003 \.004 \.005 \.006 \.007 \.008 \.009
acl ekstensiblok url_regex -i \.ace \.arj \.bzip2 \.gz \.jar \.tgz \.uue \.iso \.7-zip \.rar \.alz \.nrg \.zip \.cab \.gzip \.vpx
acl ekstensiblok url_regex -i \.lzw \.lzh \.tar \.tbz \.tar.tbz \.tar.tgz \.tar.tgz2 \.torrent \.FLV \.7z \.mp4 \.aac \.ogg \.pck
acl streamregex url_regex -i watch\? get_video\?video_id videodownload\? videoplayback\? videoplay\? dailymotion video\.[a-z]\.fbcdn\.net video\flv video\mpg video\quicktime video\x-flv video\mp4 video\x-avi video\x-mpeg video\x-wmv video\flash video\qt video\wmv

delay_pools 1    # <<< Edit dan sesuikan dengan kebutuhan Pool yang akan di buat

delay_class 1 3    
delay_parameters 1 32000/32000 20000/20000 14000/14000 # <<< 20000/20000 Bandwight yang di berikan kepada client yang tidak mengakses file atau ekstension yang di jabarkan di atas
delay_access 1 allow ekstensiblok client    # 14000/14000 Bandwight yang di berikan kepada client bila meng akses file atau ekstension yang di jabarkan di atas
delay_access 1 allow streamregex client
delay_access 1 deny all

# = Kesimpulan dari Delay Pools di atas adalah : jika client hanya browsing2 biasa mereka akan mendapatkan bandwight kurang lebih 20KB/s
# dan jika user melakukan download atau streaming dengan ekstension yang telah di jabarkan di atas maka user akan mendapatkan bandwight kurang lebih 14KB/s
# jadi sesuikan dengan situasi dan kebutuhan dimasing2 tempat....slamat mencoba dan berpusing2 ria...xixi...SALAM COSI

Popular Posts

 
viscomtech | © 2010 by DheTemplate.com | Supported by Promotions And Coupons Shopping & WordPress Theme 2 Blog