proxy Lusca di Ubuntu Server 12.04 LTS

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Re: proxy Lusca di Ubuntu Server 12.04 LTS

Post by q_p » 13 Jul 2013, 19:40

artbh wrote:kalau saya squid3 gak diinstall cuma luscanya aja..pernah diinstall kayaknya nabrak sama2 squid...dimana salahnya ya...tapi lusca nya jalan baik aja sekarang...
Ini maksudnya squid3 dan lusca di-install dalam mesin yang sama ?


User avatar
DedMax
Posts: 5
Joined: 27 Dec 2011, 14:12

Post by DedMax » 13 Jul 2013, 22:02

DedMax wrote:para master mau tanya klo game ayodance terblok dengan error sbb:
[spoiler]192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3008 GET http://122.102.49.132:81/HSUpdate/afs.dat - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html
192.168.100.15 TCP_DENIED/403 3006 GET http://122.102.49.132:81/HSUpdate/ahn.ui - NONE/- text/html[/spoiler]
berikut squid.conf yg saya gunakan:[spoiler]access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/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 proxy
cache_effective_group proxy

#=================================================================================================================================#
#=========================================================# REGEX URL #=========================================================#
#=================================================================================================================================#
coredump_dir /cache/
###############################################################################
#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 1
storeurl_rewrite_concurrency 100
#storeurl_rewrite_children 15 #7
#storeurl_rewrite_concurrency 10 #60


#=======================================================================================================================================#
#=========================================================# 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[/spoiler]
mohon pencerahaannya. terimakasih.
master tolong kasih solusinya dunk plizzz..


User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Post by q_p » 13 Jul 2013, 22:39



User avatar
Zest
Posts: 12
Joined: 13 Mar 2012, 17:24
Location: Madiun - Jatim - Indonesia
Contact:

Post by Zest » 20 Jul 2013, 21:53

Mantafff...
Selalu ijin simak Gan...
Skrg dah lancar jaya Gan...
Utk Squid Lusca dengan video cache nya...


User avatar
geon
Posts: 6
Joined: 27 Nov 2014, 22:07
Location: kota kendari

Post by geon » 15 Jan 2015, 16:52

mohon bantuannya para suhu, klo ada yg bisa remove server warnet game online.....
makasi sebelumnya..


User avatar
geon
Posts: 6
Joined: 27 Nov 2014, 22:07
Location: kota kendari

Post by geon » 15 Jan 2015, 16:57

uda nginstal ubuntu server 12.04.5 32bit berhasil, tp pas mau instal lusca n squid3 gagal trusss,...mohon bantuannya para suhu..


User avatar
Etles_T3am
Posts: 260
Joined: 26 Nov 2014, 17:08
Location: Malang-Jatim, Indonesia

Post by Etles_T3am » 16 Jan 2015, 15:00

Berikut step by step nya ;
Open terminal ;

:~$ sudo apt-get update -y && sudo apt-get upgrade -y

:~$ sudo apt-get install lusca squidclient squid-cgi ccze

Setelah terinstall semua packet Lusca, Maka selanjutnya kita buat file konfigurasi Lusca;

:~$ sudo /etc/lusca/squid.conf /etc/lusca/squid.conf.original

:~$ sudo touch /etc/lusca/squid.conf

Setelah itu kita konfigurasikan file.conf

:~$ sudo nano /etc/lusca/squid.conf

dan pastekan ini ke dalam editor nano ;

#=============================================
# Port and Transparent
#=============================================
http_port 3128 transparent
server_http11 on
icp_port 0
#=============================================
# Lusca Cache Directory
#=============================================
cache_dir aufs /cache-1/ 25000 15 256
cache_dir aufs /cache-2/ 25000 15 256
cache_dir aufs /cache-3/ 25000 15 256
cache_dir aufs /cache-4/ 25000 15 256
cache_dir aufs /cache-5/ 25000 15 256
cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA
#=============================================
# Lusca Log Options
#=============================================
emulate_httpd_log on
logformat squid %tl %6tr %>a %Ss/%03Hs %) {
@X = split;
# $X[1] =~ s/&sig=.*//;
$x = $X[0] . " ";
$_ = $X[1];
$u = $X[1];
# ==========================================================================
# Speedtest
# ==========================================================================
#if (m/^http:\/\/(.*)\/speedtest\/(.*\.(jpg|txt))\?(.*)/) {
# print $x . "http://www.speedtest.net.SQUIDINTERNAL/speedtest/" . $2 . "\n";
# ==========================================================================
# Mediafire
# ==========================================================================
#} elseif
if (m/^http:\/\/199\.91\.15\d\.\d*\/\w{12}\/(\w*)\/(.*)/) {
print $x . "http://www.mediafire.com.SQUIDINTERNAL/" . $1 ."/" . $2 . "\n";
# ==========================================================================
# Fileserve
# ==========================================================================
} elsif (m/^http:\/\/fs\w*\.fileserve\.com\/file\/(\w*)\/[\w-]*\.\/(.*)/) {
print $x . "http://www.fileserve.com.SQUIDINTERNAL/" . $1 . "./" . $2 . "\n";
# ==========================================================================
# Filesonic
# ==========================================================================
} elsif (m/^http:\/\/s[0-9]*\.filesonic\.com\/download\/([0-9]*)\/(.*)/) {
print $x . "http://www.filesonic.com.SQUIDINTERNAL/" . $1 . "\n";
# ==========================================================================
# 4shared
# ==========================================================================
} elsif (m/^http:\/\/[a-zA-Z]{2}\d*\.4shared\.com(:8080|)\/download\/(.*)\/(.*\..*)\?.*/) {
print $x . "http://www.4shared.com.SQUIDINTERNAL/download/$2\/$3\n";
# ==========================================================================
# 4shared preview
# ==========================================================================
} elsif (m/^http:\/\/[a-zA-Z]{2}\d*\.4shared\.com(:8080|)\/img\/(\d*)\/\w*\/dlink__2Fdownload_2F(\w*)_3Ftsid_3D[\w-]*\/preview\.mp3\?sId=\w*/) {
print $x . "http://www.4shared.com.SQUIDINTERNAL/$2\n";
# ==========================================================================
# Photos-X.ak.fbcdn.net where X a-z
# ==========================================================================
} elsif (m/^http:\/\/photos-[a-z](\.ak\.fbcdn\.net)(\/.*\/)(.*\.jpg)/) {
print $x . "http://photos" . $1 . "/" . $2 . $3 . "\n";
# ==========================================================================
# YX.sphotos.ak.fbcdn.net where X 1-9, Y a-z
# ==========================================================================
} elsif (m/^http:\/\/[a-z][0-9]\.sphotos\.ak\.fbcdn\.net\/(.*)\/(.*)/) {
print $x . "http://photos.ak.fbcdn.net/" . $1 ."/". $2 . "\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";
# ==========================================================================
# Compatibility for old cached get_video?video_id
# ==========================================================================
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?(videoplayback\?id=.*?|video_id=.*?)\&(.*?)/) {
$z = $2; $z =~ s/video_id=/get_video?video_id=/;
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $z . "\n";
# ==========================================================================
# Youtube fix
# ==========================================================================
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/videoplayback\?(.*)/) {
$p_str = $2;
$tag = "";
$alg = "";
$id = "";
$range = "";
if ($p_str =~ m/(itag=[0-9]*)/){$tag = "&".$1}
if ($p_str =~ m/(algorithm=[a-z]*\-[a-z]*)/){$alg = "&".$1}
if ($p_str =~ m/(id=[a-zA-Z0-9]*)/){$id = "&".$1}
if ($p_str =~ m/(range=[0-9\-]*)/){$range = "&".$1; $range =~ s/-//; $range =~ s/range=//; }
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $tag . "&" . $alg . "&" . $id . "&" . $range . "\n";
# ==========================================================================
# Google Analytic
# ==========================================================================
} 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";
# ==========================================================================
# spicific servers starts here....
# ==========================================================================
} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
print $x . "http://" . $1 . "\n";
# ==========================================================================
# cdn, varialble 1st path
# ==========================================================================
} elsif (($u =~ /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 (($u =~ /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 (($u =~ /maxporn/) && (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
print $x . "http://" . $1 . "/SQUIDINTERNAL/" . $3 . "\n";
# ==========================================================================
# like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
# ==========================================================================
} elsif (($u =~ /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";
#...spicific servers end here.
# ==========================================================================
# Photos-X.ak.fbcdn.net where X a-z
# ==========================================================================
} elsif (m/^http:\/\/photos-[a-z].ak.fbcdn.net\/(.*)/) {
print $x . "http://photos.ak.fbcdn.net/" . $1 . "\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 (($u =~ /media[0-9]{2,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";
# ==========================================================================
# Generic http://variable.domain.com/path/filename. "ext" or "exte" with or withour "? or %"
# ==========================================================================
} elsif (m/^http:\/\/(.*)(\.[^\.\-]*?\..*?)\/(.*)\.([^\/\?\&]{2,4})((\?|\%).*)?$/) {
@y = ($1,$2,$3,$4);
$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";
# ==========================================================================
# generic http://variable.domain.com/...
# ==========================================================================
} elsif (m/^http:\/\/(([A-Za-z]+[0-9-]+)*?|.*cdn.*|.*cache.*)\.(.*?)\.(.*?)\/(.*)$/) {
print $x . "http://cdn." . $3 . "." . $4 . "/" . $5 . "\n";
# ==========================================================================
# spicific extention that ends with ?
# ==========================================================================
} elsif (m/^http:\/\/(.*?)\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|on2)(.*)/) {
print $x . "http://" . $1 . "/" . $2 . "." . $3 . "\n";
# ==========================================================================
# all that ends with ;
# ==========================================================================
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
print $x . "http://" . $1 . "/" . $2 . "\n";
} else {
print $x . $_ . "sucks\n";
}
}
#=================================EOF=======================================


Save dan Exit editor nano, Lalu kita ganti Owner & Permission pada file >> /etc/squid/storeurl.pl

:~$ sudo chown proxy:proxy /etc/squid/storeurl.pl

:~$ sudo chmod +x /etc/squid/storeurl.pl

Kemudian kita juga harus mengganti Owner & Permission lusca cache directory ;

:~$ sudo chown proxy:proxy /cache-{1,2,3,4,5}

:~$ sudo chmod 777 /cache-{1,2,3,4,5}

Setelah itu kita cek apakah ada error, dengan perintah command;

:~$ lusca -d1

Apabila ada error, maka kita harus me-restart Lusca dengan command;

:~$ sudo /etc/init.d/lusca restart

ATAU

:~$ sudo service lusca restart

Sedangkan untuk Monitoring lusca access.log maka lakukan perintah command;

:~$ sudo tail -f /var/log/lusca/access.log | ccze

ATAU

:~$ sudo squidclient mgr:info



That it's......Enjoy !!


User avatar
geon
Posts: 6
Joined: 27 Nov 2014, 22:07
Location: kota kendari

Post by geon » 16 Jan 2015, 17:33

trims master...pencerahannya...


User avatar
geon
Posts: 6
Joined: 27 Nov 2014, 22:07
Location: kota kendari

Post by geon » 16 Jan 2015, 17:34

coba dulu ahhh, semoga berhasil... :-)


User avatar
Etles_T3am
Posts: 260
Joined: 26 Nov 2014, 17:08
Location: Malang-Jatim, Indonesia

Post by Etles_T3am » 17 Jan 2015, 09:05

You're welcome brother :D

Ma'af...saya se bukan master, saya newbie juga, sama seperti anda....hehehee


Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests