config squid.conf

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
Post Reply
User avatar
bellec

config squid.conf

Post 30 Jan 2014, 21:07

Selamat malam masta FUI
mohon dikoreksi dimana kekurangan konfigurasi dibawah ini karna jarang HIT dan untuk yutub juga tidak hit

ubuntu server 12.04 amd.64-bit
squid-2.7STABLE9

squid.conf
[spoiler]http_port 3128 transparent
strip_query_terms off
server_http11 on
cache_mem 8 MB
maximum_object_size_in_memory 1 KB
maximum_object_size 128 MB

memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
cache_swap_low 90%
cache_swap_high 95%

dns_nameservers 203.130.193.74 202.134.0.155

cache_dir aufs /cache1 44500 64 256
cache_dir aufs /cache2 44500 64 256
cache_dir aufs /cache3 44500 64 256
cache_dir aufs /cache4 44500 64 256
cache_dir aufs /cache5 44500 64 256
##cache_dir aufs /cache6 44500 64 256
cache_dir aufs /cache7 44500 64 256


access_log /var/log/squid/access.log
#cache_log /dev/null
cache_log /var/log/squid/cache.log
cache_store_log /dev/null

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 20 21 221 70 210 1025-65535 631 10000 901 280 488 591 777 873 110 995 25 587 995 2095 2096 2082 2083 18901-18909
#acl Safe_ports port 80 21 443 563 70 210 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl purge method PURGE
acl CONNECT method CONNECT

acl advertise url_regex -i "/etc/squid/ads.block"
deny_info http://lusca.indolini.org/fill.png advertise
http_access deny advertise

#acl yutub url_regex -i .*youtube\.com\/.*$
#acl yutub url_regex -i .*youtu\.be\/.*$
#acl redirec urlpath_regex -i .*&redirect_counter=1&cms_redirect=yes
#acl redirec urlpath_regex -i .*&ir=1&rr=12
#acl reddeny url_regex -i c\.youtube\.com\/videoplayback.*redirect_counter=1.*$
#acl reddeny url_regex -i c\.youtube\.com\/videoplayback.*cms_redirect=yes.*$

acl bokep url_regex "/etc/squid/block.txt"
acl nocache_site url_regex -i "/etc/squid/nocache_site.txt"
cache deny nocache_site
acl all src 0.0.0.0/0
acl jaringan src 192.168.0.0/16
acl jaringan src 172.16.0.0/12
acl jaringan src 10.0.0.0/8

http_access deny bokep
http_access allow manager
http_access allow localhost
http_access allow purge localhost
http_access deny purge
http_access allow jaringan
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all

#acl thunder_lst url_regex -i "/etc/thunder/thunder.lst"
#cache deny thunder_lst
#cache_peer 172.16.10.1 parent 8080 0 proxy-only no-digest
#dead_peer_timeout 2 seconds
#cache_peer_access 172.16.10.1 allow thunder_lst
#cache_peer_access 172.16.10.1 deny all

#include /etc/squid/tc3.conf

#snmp_port 3401
#acl snmppublic snmp_community public
#snmp_access allow snmppublic all

#######################################
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 streamate.doublepimp.com.*\.js\? photos-[a-z].ak.fbcdn.net \.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

acl dontrewrite url_regex redbot\.org (get_video|videoplayback\?id|videoplayback.*id).*begin\=[1-9][0-9]*

acl youtube url_regex -i youtube.*(ptracking|stream_204|player_204|gen_204) .*$
acl youtube url_regex -i (youtube|googlevideo)\.com\/(get_video|videoplayback|videoplay).*$
storeurl_access allow youtube

########
acl videocache_allow_url url_regex -i \.youtube\.[a-z][a-z]\/videoplayback \.youtube\.[a-z][a-z]\/videoplay \.youtube\.range\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/videoplay \.googlevideo\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/videoplay \.google\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.[a-z][a-z]\/videoplayback \.google\.[a-z][a-z]\/videoplay \.google\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplayback\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplay\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/get_video\?
acl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/
acl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/
acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
acl videocache_allow_url url_regex -i bitcast\.vimeo\.com\/vimeo\/videos\/
acl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
acl videocache_allow_url url_regex -i \.files\.youporn\.com\/(.*)\/flv\/
acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv
acl videocache_allow_url url_regex -i media[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/ mobile[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/ www\.tube8\.com\/(.*)\/
acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flv
acl videocache_allow_url url_regex -i \.video[a-z0-9]?[a-z0-9]?\.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram)
acl videocache_allow_url url_regex -i video\.break\.com\/(.*)\.(flv|mp4)
acl videocache_allow_dom dstdomain .mccont.com .metacafe.com .redtube.com .cdn.dailymotion.com

acl dontrewrite url_regex redbot\.org (get_video|videoplayback\?id|videoplayback.*id).*begin\=[1-9][0-9]*
acl getmethod method GET

storeurl_access allow videocache_allow_url
storeurl_access allow videocache_allow_dom

#storeurl_access deny reddeny
storeurl_access deny dontrewrite
storeurl_access deny !getmethod
storeurl_access allow store_rewrite_list_domain_CDN
storeurl_access allow store_rewrite_list
storeurl_access allow store_rewrite_list_domain store_rewrite_list_path
storeurl_access deny all
storeurl_rewrite_program /etc/squid/storeurl.pl
storeurl_rewrite_children 7
storeurl_rewrite_concurrency 10

#REFRESH PATTERN TUNNING
#==============================================================#
# 1 year = 525600 mins, 1 month = 43800 mins
refresh_pattern -i c\.android\.clients\.google\.com 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
refresh_pattern -i (youtube|google).*(videoplayback|liveplay) 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
refresh_pattern -i google\-analytics\.com.*gif 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
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).* 5259487 20% 5259487 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth ignore-must-revalidate store-stale negative-ttl=40320 max-stale=10
refresh_pattern imeem.*\.flv 0 0% 0 override-lastmod override-expire
refresh_pattern ^ftp: 40320 20% 40320 override-expire reload-into-ims store-stale
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern \.rapidshare.*\/[0-9]*\/.*\/[^\/]* 161280 90% 161280 ignore-reload store-stale
refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?) 5259487 99999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern \.(ico|video-stats) 5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod ignore-must-revalidate negative-ttl=10080 store-stale
refresh_pattern \.etology\? 5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern galleries\.video(\?|sz) 5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern brazzers\? 5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern \.adtology\? 5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern ^.*safebrowsing.*google 5259487 999999% 5259487 override-expire ignore-reload ignore-no-cache ignore-private ignore-auth ignore-must-revalidate negative-ttl=10080 store-stale
refresh_pattern ^http://((cbk|mt|khm|mlt)[0-9]?)\.google\.co(m|\.uk) 5259487 999999% 5259487 override-expire ignore-reload store-stale ignore-private negative-ttl=10080
refresh_pattern ytimg\.com.*\.jpg 5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern (avgate|avira).*(idx|gz)$ 5259487 999999% 5259487 ignore-no-cache reload-into-ims store-stale
refresh_pattern kaspersky.*\.avc$ 5259487 999999% 5259487 ignore-reload store-stale
refresh_pattern kaspersky 1440 50% 161280 ignore-no-cache store-stale
refresh_pattern images\.friendster\.com.*\.(png|gif) 5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern ((facebook.com)|(85.131.151.39)).*\.(png|gif) 5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern garena\.com 5259487 999999% 5259487 override-expire reload-into-ims store-stale
refresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 5259487 999999% 5259487 override-expire ignore-reload store-stale
refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\? 5259487 999999% 5259487 ignore-no-cache override-expire override-lastmod store-stale
refresh_pattern .fbcdn.net.*\.(jpg|gif|png) 40320 20% 40320 ignore-reload store-stale negative-ttl=5
refresh_pattern ^http:\/\/images|pics|thumbs[0-9]\. 5259487 999999% 5259487 ignore-no-cache ignore-no-store ignore-reload override-expire store-stale
refresh_pattern ^http:\/\/www.onemanga.com.*\/ 5259487 999999% 5259487 reload-into-ims override-expire store-stale
refresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 5259487 999999% 5259487 reload-into-ims override-expire ignore-private store-stale

refresh_pattern \.(jp(e?g|e|2)|gif|png|bmp|tiff?) 5259487 999999% 5259487 ignore-no-cache ignore-no-store reload-into-ims override-expire store-stale
refresh_pattern \.(z(ip|[0-9]{2})|r(ar|[0-9]{2})|jar|bz2|gz|tar|rpm|vpu) 5259487 999999% 5259487 override-expire reload-into-ims store-stale
refresh_pattern \.(mp3|wav|og(g|a)|flac|midi?|rm|aac|wma|mka|ape) 5259487 999999% 5259487 override-expire reload-into-ims ignore-reload store-stale
refresh_pattern \.(exe|msi|dmg|bin|xpi|iso|swf|mar|psf|cab) 5259487 999999% 5259487 override-expire reload-into-ims store-stale
refresh_pattern \.(mpeg|ra?m|avi|mp(g|e|4)|mov|divx|asf|wmv|m\dv|rv|vob|asx|ogm|flv|3gp|on2) 5259487 9999999% 5259487 override-expire reload-into-ims store-stale
refresh_pattern -i (cgi-bin) 0 0% 0
refresh_pattern \.(php|jsp|cgi|asx)\? 0 0% 0
refresh_pattern \.(php|jsp)$ 0 0% 0
refresh_pattern . 0 50% 161280 override-lastmod reload-into-ims store-stale

# WINDOWS UPDATE
refresh_pattern windowsupdate.com/.*\.(cab|exe) 43200 999999% 129600 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale
refresh_pattern update.microsoft.com/.*\.(cab|exe) 43200 999999% 129600 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale
refresh_pattern download.microsoft.com/.*\.(cab|exe) 43200 999999% 129600 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale

################################################################

#gemscool 203.89.146.99
refresh_pattern .gemscool.com.*\(zip) 43800 100% 43800 ignore-no-cache override-expire ignore-reload store-stale
refresh_pattern ^http://*.http://forum.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.mako.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.fs.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.atlantica.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.pb.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.onair.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.yulgang.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.ghost.gemscool.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
#lyto
refresh_pattern ^http://*.www.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.ragnarok.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.getamped.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.seal.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.rf.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.idolstreet.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.perfectworld.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.crazykart2.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.rohan.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.crossfire.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.luna.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.requiem.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.avalon.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.ge.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.avatarland.lytogame.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
#megaxus
refresh_pattern ^http://*.www.megaxus.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.ayodance.megaxus.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.lineage2.megaxus.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.warrock.megaxus.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.grandchase.megaxus.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
#rf private server
refresh_pattern ^http://*.www.rfonline.braziliancommunitygaming.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.www.rf-xtreme.*/.* 4320 100% 10080 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.pog.*/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.games.co.id/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.y8.*/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.agame.*/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.teagames.com/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.freeonlinegames.com/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.1001onlinegames.com/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims
refresh_pattern ^http://*.ligagame.com/.* 259200 100% 518400 override-expire override-lastmod reload-into-ims

# games facebook
refresh_pattern ^http:\/\/apps.facebook.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.zynga.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.farmville.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.ninjasaga.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.mafiawars.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.crowdstar.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.popcap.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.miniclip.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale

#==== Custom Option images facebook ====
refresh_pattern -i .*\.((facebook.com)|(85.131.151.39))\.(jpg|png|gif) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i .*\.fbcdn\.net\/.*\.((jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|css|js)|(jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|css|js)\?) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-private store-stale
refresh_pattern static\.ak\.fbcdn\.net*\.(jpg|gif|png) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern ^http:\/\/profile\.ak\.fbcdn.net*\.(jpg|gif|png) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
#==== End Custom Option images facebook ====



#############################################
#refresh_pattern ^ftp: 10080 95% 43200 override-lastmod reload-into-ims store-stale
#refresh_pattern ^gopher: 1440 0% 1440
#refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
#refresh_pattern . 00 95% 43200 override-lastmod reload-into-ims store-stale

via off
header_access From deny all
header_access Server deny all
header_access WWW-Authenticate deny all
header_access Link deny all
header_access Cache-Control deny all
header_access Proxy-Connection deny all
header_access X-Cache deny all
header_access X-Cache-Lookup deny all
header_access Via deny all
header_access Forwarded-For deny all
header_access X-Forwarded-For deny all
header_access Pragma deny all
header_access Keep-Alive deny all
forwarded_for off

max_filedescriptors 65536
fqdncache_size 4096
ipcache_low 98
ipcache_high 99
quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 95
shutdown_lifetime 5 seconds
memory_pools off
buffered_logs off
log_icp_queries off
logfile_rotate 1
log_fqdn off
forwarded_for off
icp_hit_stale on
query_icmp on
reload_into_ims on
emulate_httpd_log off
negative_ttl 2 minutes
pipeline_prefetch on
vary_ignore_expire on
half_closed_clients off
##high_page_fault_warning 2
nonhierarchical_direct on
prefer_direct off
#cache deny redirec
cache_mgr proxy
cache_effective_user proxy
cache_effective_group proxy
visible_hostname proxy
unique_hostname proxy
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136[/spoiler]

dan storeurl.pl
[spoiler]#!/usr/bin/perl

# Facebook Group https://www.facebook.com/groups/Mikroti ... .Indonesia
# Forum ubuntu indonesia http://ubuntu-indonesia.com/

# mohon maaf lahir batin atas kesalahan yang telah diperbuat baik sengaja ataupun tidak
# storeurl ini hasil nyontek kepunyaan chudy ( chudy_fernandez@yahoo.com )
# link asalnya adalah
# https://code.google.com/p/pfsense-cache ... toreurl.pl

# ADA BAIKNYA BANDINGKAN JUGA, AGAR TAU APAKAH SAYA COPAS MENTAH MENTAH
# SAYA TIDAK ADA MAKSUD CARI NAFKAH DARI STOREURL INI, SAYA TIDAK MENERIMA JASA SETTING WARNET ATAUPUN MEMILIKI WARNET

# for ALL Youtube ( range & non range )
# acl youtube url_regex -i youtube.*(ptracking|stream_204|player_204|gen_204) .*$
# acl youtube url_regex -i (youtube|googlevideo)\.com\/(get_video|videoplayback|videoplay).*$
# storeurl_access allow youtube

# dikarenakan ada keterangan di squid config dokumentasi seperti berikut
# NOTE: when using StoreID refresh_pattern will apply to the StoreID
# returned from the helper and not the URL.
# untuk refresh pattern di squid-3.head gunakan refresh pattern berikut untuk seluruh yg ada di sini
# refresh_pattern -i storeurl://.*SQUIDINTERNAL 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
# dan untuk storeid maka replace '$x . "' dengan '$X[0] . " OK store-id=' tanpa tanda petik tunggal (') tentunya

$|=1;
while () {
@X = split;
$x = $X[0] . " ";
$_ = $X[1];
$u = $X[1];

# Poto Pesbuk

# acl dontrewrite url_regex -i s\-platform\.ak\.fbcdn\.net
# acl store_rewrite_list url_regex -i fbcdn.*net
# refresh_pattern -i fbcdn.*net 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale

# http://external.ak.fbcdn.net/safe_image ... .jpg&cfs=1
# http://static.ak.fbcdn.net/rsrc.php/v2/ ... wuI-UM.gif
# http://static.ak.fbcdn.net/rsrc.php/v2/ ... WSBAGQ.png
# http://s-platform.ak.fbcdn.net/www/app_ ... slogin.png
# hasil atas http://bycdn8-i.akamaihd.net/antwars_id ... slogin.png
# http://profile.ak.fbcdn.net/hprofile-ak ... 0094_q.jpg
if ($X[1] =~ m/^http\:\/\/[a-zA-Z0-9\-\_\.\%]*fbcdn[a-zA-Z0-9\-\_\.\%]*net\/safe\_image\.php\?(.*)/) {
print $x . "storeurl://fbcdn.SQUIDINTERNAL/" . $1 . "\n";

} elsif ($X[1] =~ m/^http\:\/\/[a-zA-Z0-9\-\_\.\%]*fbcdn[a-zA-Z0-9\-\_\.\%]*net\/rsrc\.php\/(.*)/) {
print $x . "storeurl://fbcdn.SQUIDINTERNAL/" . $1 . "\n";

} elsif ($X[1] =~ m/^http\:\/\/[a-zA-Z0-9\-\_\.\%]*fbcdn[a-zA-Z0-9\-\_\.\%]*net\/[a-zA-Z0-9\-\_\.\%]*\/(.*)/) {
print $x . "storeurl://fbcdn.SQUIDINTERNAL/" . $1 . "\n";

# Survey Google Menggelitik
# acl store_rewrite_list url_regex -i www\.google\-analytics\.com
# refresh_pattern -i google\-analytics\.com.*gif 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
# http://www.google-analytics.com/__utm.g ... =6RAAAC%7E
} elsif ($X[1] =~ m/^http:\/\/www\.google-analytics\.com\/__utm.gif\?.*/) {
print $x . "storeurl://analytic.SQUIDINTERNAL/utm.gif\n";

# Gambar Video
# acl store_rewrite_list url_regex -i video\.google\.com\/ThumbnailServer
# refresh_pattern -i video\.google\.com\/ThumbnailServer 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
# http://video.google.com/ThumbnailServer ... oGvWdRMGy8
} elsif ($X[1] =~ m/^http:\/\/video.google.com\/ThumbnailServer.*/) {
@id = m/[&?](contentid=[a-zA-Z0-9\-\_\.\%]*)/;
@itag = m/[&?](itag=[a-zA-Z0-9\-\_\.\%]*)/;
@set = m/[&?](offsetms=[^\&\s]*)/;
print $x . "storeurl://Thumbnail.SQUIDINTERNAL/@id&@itag&@set\n";

# Video Youtube
# acl dontrewrite url_regex redbot\.org (get_video|videoplayback\?id|videoplayback.*id).*begin\=[1-9][0-9]*
# acl store_rewrite_list url_regex -i (youtube|google).*(videoplayback|liveplay)
# refresh_pattern -i (youtube|google).*(videoplayback|liveplay) 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
} elsif ($X[1] =~ m/^http(|s)\:\/\/.*youtube.*(ptracking|stream_204|player_204|gen_204).*(video_id|docid|v)\=([^\&\s]*).*/){
$vid = $4 ;
@cpn = m/[&?]cpn\=([^\&\s]*)/;
if (defined($vid )) {
$fn = "/var/log/squid/@cpn";
unless (-e $fn) {
open FH,">".$fn ;
print FH "$vid\n";
close FH;
}
}
print $x . $X[1] . "\n";

} elsif ($X[1] =~ m/^http\:\/\/.*(youtube|google).*videoplayback.*/){
@itag = m/[&?](itag=[0-9]*)/;
@ids = m/[&?]id\=([^\&\s]*)/;
@mime = m/[&?](mime\=[^\&\s]*)/;
@cpn = m/[&?]cpn\=([^\&\s]*)/;
if (defined($cpn[0])) {
$fn = "/var/log/squid/@cpn";
if (-e $fn) {
open FH,";
chomp $id ;
close FH ;
} else {
$id = $ids[0] ;
}
} else {
$id = $ids[0] ;
}
@range = m/[&?](range=[^\&\s]*)/;
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/id=" . $id . "&@itag@range@mime\n";

# Aplikasi Android
# acl dontrewrite url_regex redirector\.c\.android\.clients\.google\.com
# acl store_rewrite_list url_regex -i c\.android\.clients\.google\.com
# refresh_pattern -i c\.android\.clients\.google\.com 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
#http://android.clients.google.com/marke ... 3931383785
#http://r3---sn-vgpvopq-jb3e.c.android.c ... 2D&key=am2
} elsif ($X[1] =~ m/^http:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/([a-zA-Z0-9\-\_\.\%]*)\/([0-9]*)\/.*/){
print $x . "storeurl://android-apps.SQUIDINTERNAL/$1/$2\n";
} elsif ($X[1] =~ m/^http:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/([a-zA-Z0-9\-\_\.\%]*)\/([0-9]*)\?.*/){
print $x . "storeurl://android-apps.SQUIDINTERNAL/$1/$2\n";

# APPS APPLE
# http://a1720.phobos.apple.com/us/r1000/ ... 2.dpkg.ipa
# refresh_pattern -i phobos\.apple\.com.*ipa 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
} elsif ($X[1] =~ m/^http:\/\/[a-zA-Z0-9\-\_\.\%]*phobos\.apple\.com\/.*\/([a-zA-Z0-9\-\_\.\%]*\.ipa)/) {
print $x . "storeurl://apple-apps.SQUIDINTERNAL/$1\n";

#Speedtest
# acl store_rewrite_list url_regex -i \/speedtest\/.*(jpg|txt|png|swf)
# refresh_pattern -i \/speedtest\/.*(jpg|txt|png|swf)) 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
} elsif ($X[1] =~ m/^http\:\/\/.*\/speedtest\/([a-zA-Z0-9\-\_\.\%]*\.(jpg|txt|png|swf))\?.*/) {
print $x . "storeurl://testspeed.SQUIDINTERNAL/" . $1 . "\n";

##################################################################################

## PORN Movies
#http://porn.im.d4628d22.1534715.x.xvide ... 942a4034d4
# acl store_rewrite_list url_regex -i \.xvideos\.com\/.*(3gp|mpg|flv|mp4)
# refresh_pattern -i \.xvideos\.com\/.*(3gp|mpg|flv|mp4) 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
} elsif ($X[1] =~ m/^http:\/\/.*\.xvideos\.com\/.*\/([a-zA-Z0-9\-\_\.\%]*\.(3gp|mpg|flv|mp4))\?.*/){
print $x . "storeurl://xvideos.SQUIDINTERNAL/$1\n";

#http://154.46.32.87/key=5e2qYlZXbj6,end ... andjob.flv
# refresh_pattern -i \/xh.*(3gp|mpg|flv|mp4) 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims ignore-must-revalidate ignore-reload store-stale
} elsif ($X[1] =~ m/^http:\/\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\/.*\/xh.*\/([a-zA-Z0-9\-\_\.\%]*\.flv)/){
print $x . "storeurl://Xhamster.SQUIDINTERNAL/$1\n";

#http://213.174.156.23/key=kDRhok4XZMk,e ... lv?start=0
} elsif ($X[1] =~ m/^http:\/\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+.*\/([a-zA-Z0-9\-\_\.\%]*\.flv)\?start=0/){
print $x . "storeurl://Xhamster2.SQUIDINTERNAL/$1\n";

#http://cdn2b.youjizz.com/videos/4/e/7/e ... 84590620e5
} elsif ($X[1] =~ m/^http:\/\/.*\.youjizz\.com.*\/([a-zA-Z0-9\-\_\.\%]*\.(mp4|flv|3gp))\?.*/){
print $x . "storeurl://YouJizz.SQUIDINTERNAL/$1\n";

#http://cdn1.public.keezmovies.phncdn.co ... 56faa95822
} elsif ($X[1] =~ m/^http:\/\/[a-zA-Z0-9\-\_\.\%]*\.keezmovies[a-zA-Z0-9\-\_\.\%]*\.com.*\/([a-zA-Z0-9\-\_\.\%]*\.(mp4|flv|3gp|mpg|wmv))\?.*/){
print $x . "storeurl://KeezMovies.SQUIDINTERNAL/$1\n";

#http://cdn1.public.tube8.com/201208/30/ ... 2b07ec01fd
} elsif ($X[1] =~ m/^http:\/\/[a-zA-Z0-9\-\_\.\%]*\.tube8[a-zA-Z0-9\-\_\.\%]*\.com.*\/([a-zA-Z0-9\-\_\.\%]*\.(mp4|flv|3gp|mpg|wmv))\?.*/) {
print $x . "storeurl://Tube8.SQUIDINTERNAL/$1\n";

#http://cdn1b.public.youporn.phncdn.com/ ... 8cfb60d7b2
} elsif ($X[1] =~ m/^http:\/\/[a-zA-Z0-9\-\_\.\%]*\.youporn[a-zA-Z0-9\-\_\.\%]*\.com.*\/([a-zA-Z0-9\-\_\.\%]*\.(mp4|flv|3gp|mpg|wmv))\?.*/){
print $x . "storeurl://YouPorn.SQUIDINTERNAL/$1\n";

#http://cdn1.public.spankwire.phncdn.com ... ee1e872048
} elsif ($X[1] =~ m/^http:\/\/[a-zA-Z0-9\-\_\.\%]*\.spankwire[a-zA-Z0-9\-\_\.\%]*\.com.*\/([a-zA-Z0-9\-\_\.\%]*\.(mp4|flv|3gp|mpg|wmv))\?.*/) {
print $x . "storeurl://SpankWire.SQUIDINTERNAL/$1\n";

#http://cdn1b.embed.pornhub.phncdn.com/v ... e61dc10868
} elsif ($X[1] =~ m/^http:\/\/[a-zA-Z0-9\-\_\.\%]*\.pornhub[a-zA-Z0-9\-\_\.\%]*\.com.*\/([[a-zA-Z0-9\-\_\.\%]*\.(mp4|flv|3gp|mpg|wmv))\?.*/){
print $x . "storeurl://PornHub.SQUIDINTERNAL/$1\n";

#http://v3-xh.clients.cdn13.com/data/181 ... _ttl=14400
} elsif ($X[1] =~ m/^http:\/\/[a-zA-Z0-9\-\_\.\%\/]*.*\/([a-zA-Z0-9\-\_\.]+\.(flv|mp3|mp4|3gp|wmv))\?.*cdn\_hash.*/){
print $x . "storeurl://media.SQUIDINTERNAL/$1\n";

###################################################################################

## FileHippo
#http://fs40.filehippo.com/7642/72359c8e ... nSetup.exe
#http://fs41.filehippo.com/7662/0c4cfb99 ... 20.0b6.exe
} elsif ($X[1] =~ m/^http:\/\/.*filehippo\.com\/.*\/([0-9a-zA-Z\%\.\_\-]+\.(exe|zip|cab|msi|mru|mri|bz2|gzip|tgz|rar|pdf))/){
$y=$1;
for ($y) {
s/%20//g;
}
print $x . "storeurl://FileHippo.SQUIDINTERNAL/$y\n";

#BLOGSPOT
} elsif ($X[1] =~ m/^http:\/\/[1-4]\.bp\.blogspot\.com\/(.*)/) {
print $x . "storeurl://blogspot.SQUIDINTERNAL/" . $1 . "\n";

#ytimg
} elsif ($X[1] =~ m/^http:\/\/i[1-4]\.ytimg\.com(.*)/) {
print $x . "storeurl://ytimg.SQUIDINTERNAL" . $1 . "\n";

#AVAST
} elsif ($X[1] =~ m/^http:\/\/download[0-9]{3}\.avast\.com\/(.*)/) {
print $x . "storeurl://avast.SQUIDINTERNAL/" . $1 . "\n";

#KAV
} elsif ($X[1] =~ m/^http:\/\/dnl-[0-9]{2}\.geo\.kaspersky\.com\/(.*)/) {
print $x . "storeurl://kaspersky.SQUIDINTERNAL/" . $1 . "\n";

#maps.google.com
} elsif ($X[1] =~ m/^http:\/\/(cbk|mt|khm|mlt|tbn|mw)[0-9]?\.google\.co(m|\.uk|\.id)\/(.*)/) {
print $x . "storeurl://google.SQUIDINTERNAL/" . $3 . "\n";

#gstatic and/or wikimapia
} elsif ($X[1] =~ m/^http:\/\/([a-z])[0-9]?(\.gstatic\.com.*|\.wikimapia\.org)\/(.*)/) {
print $x . "storeurl://wikimapia.SQUIDINTERNAL/" . $3 . "\n";


#Cache High Latency Ads
} elsif ($X[1] =~ m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
$y = $3;$z = $2;
for ($y) {
s/pixel;.*/pixel/;
s/activity;.*/activity/;
s/(imgad[^&]*).*/\1/;
s/;ord=[?0-9]*//;
s/;&timestamp=[0-9]*//;
s/[&?]correlator=[0-9]*//;
s/&cookie=[^&]*//;
s/&ga_hid=[^&]*//;
s/&ga_vid=[^&]*//;
s/&ga_sid=[^&]*//;
# s/&prev_slotnames=[^&]*//
# s/&u_his=[^&]*//;
s/&dt=[^&]*//;
s/&dtd=[^&]*//;
s/&lmt=[^&]*//;
s/(&alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/(&url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/(&ref=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/(&cookie=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
s/[;&?]ord=[?0-9]*//;
s/[;&]mpvid=[^&;]*//;
s/&xpc=[^&]*//;
# yieldmanager
s/\?clickTag=[^&]*//;
s/&u=[^&]*//;
s/&slotname=[^&]*//;
s/&page_slots=[^&]*//;
}
print $x . "storeurl://" . $1 . $2 . $y . "\n";

#cache high latency ads
} elsif ($X[1] =~ m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
print $x . "storeurl://" . $1 . "/" . $2 . "\n";

} elsif ($X[1] =~ m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
print $x . "storeurl://" . $1 . "\n";

#cdn, varialble 1st path
} elsif (($X[1] =~ /filehippo/) && ($X[1] =~ m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
@y = ($1,$2,$4,$5);
$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
print $x . "storeurl://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

#rapidshare
} elsif (($X[1] =~ /rapidshare/) && ($X[1] =~ m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
print $x . "storeurl://cdn." . $3 . "/SQUIDINTERNAL/" . $5 . "\n";

} elsif (($X[1] =~ /maxporn/) && ($X[1] =~ m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
print $x . "storeurl://" . $1 . "/SQUIDINTERNAL/" . $3 . "\n";

#domain/path/.*/path/filename
} elsif (($X[1] =~ /fucktube/) && ($X[1] =~ m/^http:\/\/(.*?)(\.[^\.\-]*?[^\/]*\/[^\/]*)\/(.*)\/([^\/]*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
@y = ($1,$2,$4,$5,$6);
$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
print $x . "storeurl://" . $y[0] . $y[1] . "/" . $y[2] . "/" . $y[3] . "." . $y[4] . "\n";

#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($X[1] =~ /tube8|pornhub|xvideos/) && ($X[1] =~ m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?(\.[a-z]*)?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
print $x . "storeurl://cdn." . $4 . $6 . "\n";

#general purpose for cdn servers. add above your specific servers.
} elsif ($X[1] =~ m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
print $x . "storeurl://squid-cdn-url/" . $2 . "." . $3 . "\n";

} elsif ($X[1] =~ m/^http:\/\/(.*?)(\.[^\.\-]*?\..*?)\/([^\?\&\=]*)\.([\w\d]{2,4})\??.*$/) {
@y = ($1,$2,$3,$4);
$y[0] =~ s/([a-z][0-9][a-z]dlod[\d]{3})|((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
print $x . "storeurl://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

# all that ends with ;
} elsif ($X[1] =~ m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
print $x . "storeurl://" . $1 . "/" . $2 . "\n";

} else {
print $x . $X[1] . "\n";
}
# end
}[/spoiler]

mohon diberi masukan master :)


User avatar
densuj88

Post 20 Feb 2014, 01:50

gan mohon pencerahan squid bisa bwt pake trik internet gratis GSM gk?


Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests