Share Config Lusca

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 03:43

Hi all,....
Saya mau share config lusca.
Mohon bantuan warga FUI untuk oprek bersama.
Thank's SyaifuddinJW.

config lusca
Tampilkan
http_port 3128 transparent
server_http11 on

pid_filename /var/run/squid.pid
coredump_dir /var/spool/squid/
error_directory /usr/share/squid/errors/English
icon_directory /usr/share/squid/icons
mime_table /etc/squid/mime.conf

cache_mem 8 MB
maximum_object_size_in_memory 512 bytes
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA

quick_abort_min -1 KB
minimum_object_size 512 bytes
maximum_object_size 4 GB
cache_swap_low 97
cache_swap_high 99

cache_dir aufs /cache 50000 16 256

access_log daemon:/var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log none
store_dir_select_algorithm round-robin
logfile_daemon /usr/lib/squid/logfile-daemon
logfile_rotate 1

strip_query_terms off
acl youtube url_regex -i .*youtube\.com\/.*$
acl youtube url_regex -i .*youtu\.be\/.*$
logformat squid1 %{Referer}>h %ru
access_log /var/log/squid/yt.log squid1 youtube

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 10.0.0.0/8
acl localnet src 172.16.0.0/12
acl localnet src 192.168.0.0/16


acl SSL_ports port 443
acl Safe_ports port 80 21 443 70 210 1025-65535 280 488 591 777
acl CONNECT method CONNECT
acl purge method PURGE
acl snmppublic snmp_community public

include /etc/squid/refresh.conf

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny virus

http_access allow localnet
http_access allow all
http_access deny all

icp_access allow localnet
icp_access deny all
icp_port 0

buffered_logs on

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

forwarded_for off
header_access From deny all
header_access Server deny all
header_access Link deny all
header_access Via deny all
header_access X-Forwarded-For deny all
httpd_suppress_version_string on

shutdown_lifetime 10 seconds

snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic all

dns_timeout 1 minutes

fqdncache_size 16384
ipcache_size 16384
ipcache_low 97
ipcache_high 99
log_fqdn off
memory_pools off

maximum_single_addr_tries 2
retry_on_error on

icp_hit_stale on
query_icmp on
reload_into_ims on
emulate_httpd_log off
negative_ttl 0 seconds
pipeline_prefetch on
vary_ignore_expire on
half_closed_clients off
high_page_fault_warning 2
nonhierarchical_direct on
prefer_direct off
cache_mgr proxy
cache_effective_user proxy
cache_effective_group proxy
visible_hostname proxy
unique_hostname proxy
cachemgr_passwd none all
client_db on
max_filedescriptors 8192

zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136


refresh.conf
Tampilkan
#acl store_rewrite_list urlpath_regex \/(get_video\?|videodownload\?|videoplayback.*id)
#acl store_rewrite_list url_regex -i \.youtube\.com\/get_video\?
#acl store_rewrite_list url_regex -i \.youtube\.com\/videoplayback \.youtube\.com\/videoplay \.youtube\.com\/get_video\?
#acl store_rewrite_list url_regex -i \.youtube\.[a-z][a-z]\/videoplayback \.youtube\.[a-z][a-z]\/videoplay \.youtube\.[a-z][a-z]\/get_video\?
acl store_rewrite_list urlpath_regex \/(get_video|video\?v|videoplayback\?id|videoplayback.*id)
acl store_rewrite_list urlpath_regex \/(get_video\?|videodownload\?|videoplayback.*id|watch\?)
acl store_rewrite_list urlpath_regex \.(3gp|mp(3|4)|flv|(m|f)4v|on2|fid|avi|mov|wm(a|v)|(mp(e?g|a|e|1|2))|mk(a|v)|jp(e?g|e|2)|gif|png|tiff?|bmp|tga|svg|ico|swf|exe|ms(i|u|p)|cab|psf|mar|bin|z(ip|[0-9]{2})|r(ar|[0-9]{2})|7z)\?
acl store_rewrite_list_domain url_regex ^http:\/\/(([a-z-]+[0-9-]+)|([0-9-]+[a-z-]+))\.[a-z0-9-]*\.[a-z]{2,4}
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 \.(3gp|mp(3|4)|flv|(m|f)4v|on2|fid|avi|mov|wm(a|v)|(mp(e?g|a|e|1|2))|mk(a|v)|jp(e?g|e|2)|gif|png|tiff?|bmp|tga|svg|ico|swf|exe|ms(i|u|p)|cab|psf|mar|bin|z(ip|[0-9]{2})|r(ar|[0-9]{2})|7z)$
acl store_rewrite_list_domain_CDN url_regex (cbk|mt|khm|mlt|tbn)[0-9]?.google\.co(m|\.uk|\.id)
acl store_rewrite_list_domain_CDN url_regex photos-[a-z].ak.fbcdn.net
acl store_rewrite_list_domain_CDN url_regex ^http:\/\/([a-z])[0-9]?(\.gstatic\.com|\.wikimapia\.org)
acl store_rewrite_list_domain_CDN url_regex ^http:\/\/[.a-z0-9]*\.photobucket\.com.*\.[a-z]{3}$
acl store_rewrite_list_domain_CDN url_regex streamate.doublepimp.com.*\.js\? \.doubleclick\.net.* yieldmanager cpxinteractive quantserve\.com
acl speedtest_allow_url url_regex -i \.speedtest\.net\/ speedtest
acl speedtest_allow_url url_regex ^http:\/\/speedtest\.*
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 speedtest_allow_dom dstdomain .speedtest.net
acl cache_allow_dom dstdomain .youtube.com .googlevideo.com .4shared.com .speedtest.net

acl dontrewrite url_regex (get_video|video\?v=|videoplayback\?id|videoplayback.*id).*begin\=[1-9][0-9]* \.php\? \.asp\? \.aspx\? threadless.*\.jpg\?r=
acl getmethod method GET

storeurl_access deny dontrewrite
storeurl_access deny !getmethod

cache deny redirec
storeurl_access deny reddeny
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 allow speedtest_allow_url
storeurl_access allow speedtest_allow_dom
storeurl_access allow cache_allow_dom
storeurl_access deny all
storeurl_rewrite_program /etc/squid/storeurl-r25.pl
storeurl_rewrite_children 7
storeurl_rewrite_concurrency 15


acl DENYCACHE urlpath_regex \.(ini|ui|lst|inf|pak|ver|patch|md5|cfg|lst|list|rsc|log|conf|dbd|db|xml|cfg.iop)$ afs\.dat$
acl DENYCACHE urlpath_regex -i (mrtg|include|Loader|xtrap|login|captcha|notice|sources|registration|voucher|partialinfo)
acl DENYCACHE urlpath_regex (notice.html|afs.dat|dat.asp|patchinfo.xml|version.list|iepngfix.htc|updates.txt|patchlist.txt)
acl DENYCACHE urlpath_regex (pointblank.css|login_form.css|form.css)$
acl DENYCACHE urlpath_regex (Loader|gamenotice|sources|captcha|notice|reset)
cache deny DENYCACHE

acl virus url_regex \.(scr|bat|pif|cmd)$

#Image
refresh_pattern \.(jp(e?g|e|2)|tiff?|bmp|gif|png|pcx|svgpic|max|dxf|ep)$ 5259487 99999999% 5259487 override-expire reload-into-ims ignore-no-cache ignore-private ignore-no-store ignore-auth ignore-must-revalidate store-stale negative-ttl=0
refresh_pattern \.(swf|flv|fid|avi|mov|wm(a|v)|3gp|mp(4|3)|rm|ram|m4v|on2|mar|cab|psf)$ 259200 999999% 5259487 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-auth ignore-must-revalidate store-stale negative-ttl=0

#Youtube
refresh_pattern (get_video\?|videoplayback\?|videodownload\?) 5259487 99999999% 5259487 override-expire ignore-reload ignore-private negative-ttl=0
refresh_pattern -i \.(flv)$ 10080 90% 999999 ignore-no-cache override-expire ignore-private
#refresh_pattern -i \.flv$ 10080 90% 999999 ignore-no-cache override-expire ignore-private
#refresh_pattern (get_video\?|videoplayback\?|videodownload\?) 5259487 99999999% 5259487 override-expire ignore-reload negative-ttl=0
#refresh_pattern ^http://[^/]+\.youtube\.com/(get_video|video|videoplayback|videodownload).*(begin|start)\=[1-9][0-9]* 0 0% 0
#refresh_pattern ^http://[^/]+\.youtube\.com/(get_video\?|videoplayback\?|videodownload\?) 43200 99999999% 259200 override-expire ignore-reload ignore-must-revalidate ignore-no-cache ignore-no-store ignore-private store-stale negative-ttl=0
#refresh_pattern (get_video\?|videoplayback\?|videodownload\?|watch\?\.flv?|.vid\?) 2629742 99999999% 2629742 override-expire ignore-reload ignore-must-revalidate ignore-no-cache ignore-no-store ignore-private store-stale negative-ttl=0

#Sensitive files
refresh_pattern \.(sc-|dl-|ex-|mh-|dll|da-|cfg.iop|Xtp)$ 0 10% 50 reload-into-ims
refresh_pattern (update-smadav|updates|patchlist|start|start1|start2|start3)\.txt$ 0 20% 1440 reload-into-ims
refresh_pattern (pointblank|form|reset|ickernew|layout)\.css$ 0 10% 1440 reload-into-ims
refresh_pattern (all.png|dat.asp|patchinfo.xml|iepngfix.htc)$ 0 10% 1440 reload-into-ims
refresh_pattern (game|cookie)\.js$ 0 10% 1440 reload-into-ims
refresh_pattern (autoup|main|autoupgrade|grandchase|FSLauncher|FreeStyle_Setup|grandchase|cabal|i7|UpdaterModifier|FreeStyle|PBLauncher|update|NewLauncher|NewAvalon)\.exe$ 0 50% 1440 reload-into-ims
refresh_pattern (PointBlank.exe|HSUpdate.exe|PBConfig.exe|hon.exe|filelist)\.zip$ 0 50% 1440 reload-into-ims
refresh_pattern -i (livescore.com|goal.com|bobet|bet) 0 50% 60 reload-into-ims

refresh_pattern \.(aspx|asp|php|css|htm|html|js|jsp|xml)$ 20 80% 20160 reload-into-ims
refresh_pattern \.(nzp|iop|kom|nup|mst)$ 43200 99999999% 5259487 override-expire reload-into-ims ignore-no-cache

#Regex spesific
refresh_pattern (gstatic|diggstatic)\.com/.* 43200 999999% 259200 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern (zynga|ninjasaga|mafiawars|cityville|farmville|crowdstar|spilcdn|agame|popcap)\.com/.* 43200 999999% 259200 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern ^http:\/\/images|image|img|pics|openx|thumbs[0-9]\. 43200 999999% 259200 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern ^.*safebrowsing.*google 259200 999999% 259200 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth ignore-must-revalidate negative-ttl=10080 store-stale
refresh_pattern ^.*(streamate.doublepimp.com.*\.js\?|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).* 43200 20% 259200 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth ignore-must-revalidate store-stale negative-ttl=40320 max-stale=1440
refresh_pattern \.(ico|video-stats) 43200 999999% 259200 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 ^http://((cbk|mt|khm|mlt|tbn)[0-9]?)\.google\.co(m|\.uk|\.id) 43200 999999% 259200 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-auth ignore-must-revalidate ignore-no-store negative-ttl=10080 store-stale
#refresh_pattern \.speedtest/.* 43200 99999% 259200 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate store-stale negative-ttl=10080
refresh_pattern .speedtest.* 0 60% 10 negative-ttl=0
refresh_pattern \.wikimapia\.org\/? 43200 99999% 259200 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-must-revalidate store-stale
refresh_pattern (resize|timthumb|product_thumb|thumb|img|imag(e|es))\.php? 43200 99999999% 5259487 override-expire ignore-reload ignore-no-cache store-stale

refresh_pattern \.(jp(e?g|e|2)|tiff?|bmp|gif|png|pcx|svgpic|max|dxf|ep)\? 259200 99999999% 5259487 override-expire reload-into-ims ignore-no-cache ignore-private ignore-no-store ignore-auth ignore-must-revalidate store-stale negative-ttl=0
refresh_pattern \.(nzp|swf|flv|fid|avi|mov|wm(a|v)|3gp|mp(4|3)|rm|ram|m4v|on2)\? 259200 99999999% 5259487 override-expire ignore-reload ignore-must-revalidate ignore-no-cache ignore-no-store ignore-private store-stale negative-ttl=0
refresh_pattern \.(z(ip|[0-9]{2})|r(ar|[0-9]{2})|jar|bz2|gz|tar|rpm|vpu|vpx) 43200 99999999% 259200 override-expire reload-into-ims ignore-no-cache ignore-private ignore-must-revalidate ignore-no-store store-stale
refresh_pattern \.(mp3|mp4|wav|og(g|a)|flac|midi?|rm|aac|wma|mka|ape) 43200 99999999% 259200 override-expire reload-into-ims ignore-reload ignore-no-cache ignore-private ignore-must-revalidate ignore-no-store store-stale
refresh_pattern \.(exe|msi|msp|msu|dmg|bin|xpi|iso|mar|psf|cab) 43200 99999999% 259200 override-expire ignore-reload ignore-no-cache ignore-private ignore-must-revalidate ignore-no-store store-stale
refresh_pattern \.(mpeg|ra?m|avi|mp(g|e|4)|mov|divx|asf|wmv|mkv|m\dv|rv|vob|asx|ogm|flv|3gp|on2) 43200 999999% 259200 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-auth ignore-must-revalidate ignore-no-store negative-ttl=0 store-stale
refresh_pattern \.(doc|docx|pdf|ppt|pptx|psd|rtf|xls|xlsx) 43200 99999999% 5259487 override-expire reload-into-ims ignore-no-cache ignore-must-revalidate
refresh_pattern -i (cgi-bin) 0 0% 0
refresh_pattern \.(php|jsp|cgi|asx|asp|aspx|js)\? 0 0% 0
refresh_pattern . 0 50% 259200 store-stale


storeurl-r25.pl
https://code.google.com/p/tempat-sampah ... toreurl.pl
Tampilkan
#!/usr/bin/perl
# $Rev$
# by chudy_fernandez@yahoo.com
# rev by ucok_karnadi@yahoo.com
# Youtube updates at http://wiki.squid-cache.org/ConfigExamp ... Discussion

# http://www.facebook.com/stressss

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

#facebook
if (m/^http\:\/\/.*(profile|photo).*\.ak\.fbcdn\.net(\/h(profile|photos)-ak-)(snc|ash|prn)[0-9]?(.*)/) {
print $x . "http://facebook.SQUIDINTERNAL" . $2 . "fb" . $5 . "\n";

#Speedtest
} elsif (m/^http\:\/\/.*\/speedtest\/(.*)\?.*/) {
print $x . "http://speedtest.SQUIDINTERNAL/speedtest/" . $1 . "\n";

#reverbnation
} elsif (m/^http:\/\/[a-z0-9]{4}\.reverbnation\.com\/.*\/([0-9]*).*/) {
print $x . "http://reverbnation.com.SQUIDINTERNAL/" . "$1" . "\n";

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

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

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

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

#AVG
} elsif (m/^http:\/\/update.avg.com/) {
print $x . "http://avg-cdn." . $1 . "\n";

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

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

#maps.google.com
} elsif (m/^http:\/\/(khm|mt)[0-9]?(.google.com.*)/) {
print $x . "http://" . $1 . $2 . "\n";

# for ALL Youtube ( range & non range )
# first you need do this
# install package dependencies "apt-get install libfile-readbackwards-perl"
# add line below to your squid config and remove "#"

# strip_query_terms off
# acl yutub url_regex -i .*youtube\.com\/.*$
# acl yutub url_regex -i .*youtu\.be\/.*$
# logformat squid1 %{Referer}>h %ru
# access_log /var/log/squid/yt.log squid1 yutub
# acl redirec urlpath_regex -i .*&redirect_counter=1&cms_redirect=yes
# acl redirec urlpath_regex -i .*&ir=1&rr=12
# cache deny redirec
# acl reddeny url_regex -i c\.youtube\.com\/videoplayback.*redirect_counter=1.*$
# acl reddeny url_regex -i c\.youtube\.com\/videoplayback.*cms_redirect=yes.*$
# storeurl_access deny reddeny

} elsif ($X[1] =~ m/^http\:\/\/.*(youtube|google).*videoplayback.*/){
@itag = m/[&?](itag=[0-9]*)/;
@CPN = m/[&?]cpn\=([a-zA-Z0-9\-\_]*)/;
@IDS = m/[&?]id\=([a-zA-Z0-9\-\_]*)/;
$id = &GetID($CPN[0], $IDS[0]);
@range = m/[&?](range=[^\&\s]*)/;
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/id=" . $id . "&@itag@range\n";

#Google
} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
print $x . "http://www.google-analytics.com/__utm.gif\n";

#Cache High Latency Ads
} elsif (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 . "http://" . $1 . $2 . $y . "\n";

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

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

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

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

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

#domain/path/.*/path/filename
} elsif (($X[1] =~ /fucktube/) && (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 . "http://" . $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/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?(\.[a-z]*)?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
print $x . "http://cdn." . $4 . $6 . "\n";

#for yimg.com video
} elsif (m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
print $x . "http://cdn.yimg.com/" . $3 . "\n";

#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
print $x . "http://cdn.yimg.com/" . $3 . "\n";

#for yimg.com with &sig=
} elsif (m/^http:\/\/([^\.]*)\.yimg\.com\/(.*)/) {
@y = ($1,$2);
$y[0] =~ s/[a-z]+([0-9]+)?/cdn/;
$y[1] =~ s/&sig=.*//;
print $x . "http://" . $y[0] . ".yimg.com/" . $y[1] . "\n";

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

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

# spicific extention
# } elsif (m/^http:\/\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|swf).*?/) {
# @y = ($1,$2);
# $y[0] =~ s/((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
# print $x . "http://" . $y[0] . "." . $y[1] . "\n";

#generic http://variable.domain.com/path/filename. "ext" or "exte"
#http://cdn1-28.projectplaylist.com
#http://s1sdlod041.bcst.cdn.s1s.yimg.com
} elsif (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 (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
print $x . "http://" . $1 . "/" . $2 . "\n";

} else {
print $x . $X[1] . "\n";
}
}


sub GetID
{
$id = "";
use File::ReadBackwards;
my $lim = 200 ;
my $ref_log = File::ReadBackwards->new('/var/log/squid/yt.log');
while (defined($line = $ref_log->readline))
{
if ($line =~ m/.*youtube.*\/watch\?.*v=([a-zA-Z0-9\-\_]*).*\s.*id=$IDS[0].*/){
$id = $1;
last;
}
if ($line =~ m/.*youtube.*\/.*cpn=$CPN[0].*[&](video_id|docid|v)=([a-zA-Z0-9\-\_]*).*/){
$id = $2;
last;
}
if ($line =~ m/.*youtube.*\/.*[&?](video_id|docid|v)=([a-zA-Z0-9\-\_]*).*cpn=$CPN[0].*/){
$id = $2;
last;
}
last if --$lim close();
return $id;
}
User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Re: Share Config Lusca

Postby q_p » 13 Apr 2013, 05:31

Saya kira semua sepakat, untuk mengacu ke file yang selalu disertakan yaitu squid.conf.default sebagai buku putihnya.
Bagaimana kalau menggunakan include sebagaimana disebutkan di squid.conf.default, di bawah ini saya kutipkan =
squid.conf.default
# Configuration options can be included using the "include" directive.
# Include takes a list of files to include. Quoting and wildcards is
# supported.
#
# For example,
#
[color:#990000]# include /path/to/included/file/squid.acl.config[/color]
#
# Includes can be nested up to a hard-coded depth of 16 levels.
# This arbitrary restriction is to prevent recursive include references
# from causing Squid entering an infinite loop whilst trying to load
# configuration files.

Kenapa pihak developer squid menaruh kutipan tsb di bagian paling atas squid.conf.default ?
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 09:13

Thank's masukannya
User avatar
sipelaut
Posts: 1963
Joined: 03 Jan 2010, 17:25
Location: madura-sampang
Contact:

Re: Share Config Lusca

Postby sipelaut » 13 Apr 2013, 12:33

mas pragola, maksudnya gimana yaa untuk file include
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 12:44

file include itu
maksudnya utk mempermudah melakukan proses cek / penambahan rule baru
kira2 segitu menurut saya
User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Re: Share Config Lusca

Postby q_p » 13 Apr 2013, 12:44

Code: Select all

squidclient mgr:info > mgrinfo.txt
nano mgrinfo.text

Jalankan pada jam2 sibuk mas, output-nya anda kopas di sini.
Setelah itu anda bisa hapus

Code: Select all

rm mgrinfo.txt
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 13:24

mgrinfo.text

Tampilkan
HTTP/1.0 200 OK
Date: Sat, 13 Apr 2013 06:21:18 GMT
Content-Type: text/plain
Expires: Sat, 13 Apr 2013 06:21:18 GMT
X-Cache: MISS from proxy
X-Cache-Lookup: MISS from proxy:3128
Connection: close

Squid Object Cache: Version LUSCA_HEAD-r14809
Start Time: Sat, 13 Apr 2013 06:04:22 GMT
Current Time: Sat, 13 Apr 2013 06:21:18 GMT
Connection information for squid:
Number of clients accessing cache: 4
Number of HTTP requests received: 1533
Number of ICP messages received: 0
Number of ICP messages sent: 0
Number of queued ICP replies: 0
Number of HTCP messages received: 0
Number of HTCP messages sent: 0
Request failure ratio: 0.00
Average HTTP requests per minute since start: 90.5
Average ICP messages per minute since start: 0.0
Select loop called: 110223 times, 9.217 ms avg
Cache information for squid:
Request Hit Ratios: 5min: 28.6%, 60min: 24.3%
Byte Hit Ratios: 5min: 33.9%, 60min: 22.3%
Request Memory Hit Ratios: 5min: 3.6%, 60min: 3.4%
Request Disk Hit Ratios: 5min: 95.4%, 60min: 94.4%
Storage Swap size: 1970460 KB
Storage Mem size: 1356 KB
Mean Object Size: 64.42 KB
Requests given to unlinkd: 0
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 0.15888 0.19742
Cache Misses: 0.30459 0.35832
Cache Hits: 0.00091 0.00091
Near Hits: 0.00000 0.22004
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.00000 0.00000
ICP Queries: 0.00000 0.00000
Resource usage for squid:
UP Time: 1015.893 seconds
CPU Time: 4.428 seconds
CPU Usage: 0.44%
CPU Usage, 5 minute avg: 0.71%
CPU Usage, 60 minute avg: 0.43%
Process Data Segment Size via sbrk(): 9116 KB
Maximum Resident Size: 64112 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
Total space in arena: 9116 KB
Ordinary blocks: 8838 KB 353 blks
Small blocks: 0 KB 0 blks
Holding blocks: 4984 KB 3 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 277 KB
Total in use: 13822 KB 98%
Total free: 277 KB 2%
Total size: 14100 KB
Memory accounted for:
Total accounted: 4103 KB
memPoolAlloc calls: 422839
memPoolFree calls: 351723
File descriptor usage for squid:
Maximum number of file descriptors: 1024
Largest file desc currently in use: 227
Number of file desc currently in use: 110
Files queued for open: 0
Available number of file descriptors: 914
Reserved number of file descriptors: 100
Store Disk files open: 1
IO loop method: epoll
Internal Data Structures:
30618 StoreEntries
318 StoreEntries with MemObjects
313 Hot Object Cache Items
30587 on-disk objects
User avatar
sawitbahar
Posts: 41
Joined: 04 Apr 2013, 17:51
Location: jambi

Re: Share Config Lusca

Postby sawitbahar » 13 Apr 2013, 13:31

FATAL: Unable to find configuration file: /etc/squid/refresh.conf: (2) No such file or directory
Squid Cache (Version LUSCA_FMI): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 6912 KB
Page faults with physical i/o: 0
Aborted (core dumped)
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 13:33

refresh.conf nya tidak ada
coba dibuat file refresh.conf dalam direktory /etc/squid
liat di spoiler refresh.conf
User avatar
sawitbahar
Posts: 41
Joined: 04 Apr 2013, 17:51
Location: jambi

Re: Share Config Lusca

Postby sawitbahar » 13 Apr 2013, 13:53

root@alamsyah:~# /etc/init.d/squid restart
chmod: cannot access `/etc/init.d/squid\r': No such file or directory
/etc/init.d/squid: line 2: $'===================================================\r': command not found
/etc/init.d/squid: line 19: $'\r': command not found
/etc/init.d/squid: line 25: $'\r': command not found
/etc/init.d/squid: line 26: /etc/d: No such file or directory
/etc/init.d/squid: line 27: $'\r': command not found
/: No such file or directory/lib/lsb/init-functions
/etc/init.d/squid: line 29: $'\r': command not found
/etc/init.d/squid: line 31: $'\r': command not found
/etc/init.d/squid: line 32: e: numeric argument required
root@alamsyah:~#

Keluar gini kan klu /etc/init.d/squid restart
User avatar
sawitbahar
Posts: 41
Joined: 04 Apr 2013, 17:51
Location: jambi

Re: Share Config Lusca

Postby sawitbahar » 13 Apr 2013, 13:53

root@alamsyah:~# /etc/init.d/squid restart
chmod: cannot access `/etc/init.d/squid\r': No such file or directory
/etc/init.d/squid: line 2: $'===================================================\r': command not found
/etc/init.d/squid: line 19: $'\r': command not found
/etc/init.d/squid: line 25: $'\r': command not found
/etc/init.d/squid: line 26: /etc/d: No such file or directory
/etc/init.d/squid: line 27: $'\r': command not found
/: No such file or directory/lib/lsb/init-functions
/etc/init.d/squid: line 29: $'\r': command not found
/etc/init.d/squid: line 31: $'\r': command not found
/etc/init.d/squid: line 32: e: numeric argument required
root@alamsyah:~#

Keluar gini kan klu /etc/init.d/squid restart
User avatar
sipelaut
Posts: 1963
Joined: 03 Jan 2010, 17:25
Location: madura-sampang
Contact:

Re: Share Config Lusca

Postby sipelaut » 13 Apr 2013, 14:02

JuldianTan wrote:file include itu
maksudnya utk mempermudah melakukan proses cek / penambahan rule baru
kira2 segitu menurut saya

untuk penulisannya seperti apa sichh yang bener ???
User avatar
sawitbahar
Posts: 41
Joined: 04 Apr 2013, 17:51
Location: jambi

Re: Share Config Lusca

Postby sawitbahar » 13 Apr 2013, 14:04

FATIN SHIDQIA - MERCY (Duffy) - GALA SHOW 7 - X Factor Indonesia 5 April 2013


koq eroooorrrr video ini gan lainya terbuka
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 14:21

coba ganti file /etc/init.d/squid

Tampilkan
nano /etc/init.d/squid | chmod +x /etc/init.d/squid
===================================================
#! /bin/sh
#
# squid Startup script for the SQUID HTTP proxy-cache.
#
# Version: @(#)squid.rc 2.20 01-Oct-2001 miquels@cistron.nl
#
### BEGIN INIT INFO
# Provides: squid
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Squid HTTP Proxy
### END INIT INFO

NAME=squid
DAEMON=/usr/sbin/squid
LIB=/usr/lib/squid
PIDFILE=/var/run/$NAME.pid
SQUID_ARGS="-D -YC"

[ ! -f /etc/default/squid ] || . /etc/default/squid

. /lib/lsb/init-functions

PATH=/bin:/usr/bin:/sbin:/usr/sbin

[ -x $DAEMON ] || exit 0

grepconf () {
w=" " # space tab
sq=/etc/squid/squid.conf
# sed is cool.
res=`sed -ne '
s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
t end;
d;
:end q' /proc/sys/fs/file-max
fi
ulimit -n $SQUID_MAXFD
}

start () {
cdr=`grepconf2 cache_dir /var/spool/$NAME`
ctp=`grepconf cache_dir ufs`

case "$cdr" in
[0-9]*)
log_failure_msg "squid: squid.conf contains 2.2.5 syntax - not starting!"
log_end_msg 1
exit 1
;;
esac

#
# Create spool dirs if they don't exist.
#
if [ -d "$cdr" -a ! -d "$cdr/00" ] || [ "$ctp" = "coss" -a ! -w "$cdr" ]
then
log_warning_msg "Creating squid cache structure"
$DAEMON $SQUID_ARGS -z
fi

if [ "$CHUID" = "" ]; then
CHUID=root
fi

maxfds
umask 027
start-stop-daemon --quiet --start \
--pidfile $PIDFILE \
--chuid $CHUID \
--exec $DAEMON -- $SQUID_ARGS /dev/null`
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name squid
#
# Now we have to wait until squid has _really_ stopped.
#
sleep 2
if test -n "$PID" && kill -0 $PID 2>/dev/null
then
log_action_begin_msg " Waiting"
cnt=0
while kill -0 $PID 2>/dev/null
do
cnt=`expr $cnt + 1`
if [ $cnt -gt 24 ]
then
log_action_end_msg 1
return 1
fi
sleep 5
log_action_cont_msg ""
done
log_action_end_msg 0
return 0
else
return 0
fi
}

case "$1" in
start)
log_daemon_msg "Starting Squid HTTP proxy" "squid"
if start ; then
log_end_msg $?
else
log_end_msg $?
fi
;;
stop)
log_daemon_msg "Stopping Squid HTTP proxy" "squid"
if stop ; then
log_end_msg $?
else
log_end_msg $?
fi
;;
reload|force-reload)
log_action_msg "Reloading Squid configuration files"
$DAEMON -k reconfigure
log_action_end_msg 0
;;
restart)
log_daemon_msg "Restarting Squid HTTP proxy" "squid"
stop
if start ; then
log_end_msg $?
else
log_end_msg $?
fi
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON" squid && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}"
exit 3
;;
esac

exit 0
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 14:22

link youtubenya apa
User avatar
sawitbahar
Posts: 41
Joined: 04 Apr 2013, 17:51
Location: jambi

Re: Share Config Lusca

Postby sawitbahar » 13 Apr 2013, 14:39

User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 15:07

sawitbahar wrote:http://www.youtube.com/watch?v=CmwjluiMSBQ
ini gan


bro, kalo saya tes disini gak mslh.
coba cek config / settingan lainnya.
User avatar
JuldianTan
Posts: 45
Joined: 25 Mar 2013, 04:07
Location: Palembang, Indonesia
Contact:

Re: Share Config Lusca

Postby JuldianTan » 13 Apr 2013, 22:47


Return to “Ubuntu Server”

Who is online

Users browsing this forum: No registered users and 3 guests