Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(share) proxy squid stable 2.7 stable 9 instalasi dan konfigurasi newbie version
#1
jalankan sebagai root, secara default root tidak memiliki password setelah install ubuntu server.
Code:
# sudo su # passwd password_baru

update linux :
Code:
# apt-get update

install packet yang dibutuhkan :
Code:
# apt-get install squid squidclient squid-cgi gcc build-essential sharutils ccze libzip-dev automake1.9 acpid
acpid : biar sekali klik tu pc langsung mokat

download squid 2.7 stable 9+patch : (bisa cache video yutub)
Code:
# wget http://mikrotik-squid.googlecode.com/files/squid-2.7.STABLE9%2Bpatch.tar.gz # tar xvf squid-2.7.STABLE9+patch.tar.gz # cd squid-2.7.STABLE9

compile scriptnya :
Code:
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs --enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp --enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files --enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536

Kemudian:
Code:
# make # make install
dikarenakan adanya bug pada ubuntu 10.04 lts di service squidnya, maka ini berbeda dari ubuntu 10.10 lts

agar bisa stop service squid maka untuk ubuntu 10.04 lts, buat sebuah file di directory /etc/init.d/:
Code:
# nano /etc/init.d/squid

isinya :
Code:
#! /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' < $sq` [ -n "$res" ] || res=$2 echo "$res" }

berikan hak ases / berikan owner ke pada user proxy dan group proxy begitu selanjutnya dan berikan permission file squid tersebut untuk di execute:
Code:
# chown proxy:proxy /etc/init.d/squid # chmod 777 /etc/init.d/squid

stop service squid:
Code:
# /etc/init.d/squid stop

backup konfigurasi squid.conf dan buat file squid.conf yang baru :
Code:
# mv /etc/squid/squid.conf /etc/squid/squid.conf.aseli # nano /etc/squid/squid.conf

Code:
##start of config http_port 3128 transparent server_http11 on icp_port 0 # File Squid pid_filename /var/run/squid.pid coredump_dir /var/spool/squid/ error_directory /usr/share/squid/errors/en/ icon_directory /usr/share/squid/icons mime_table /usr/share/squid/mime.conf visible_hostname beben-dayak # Log Squid access_log /var/log/squid/access.log cache_log /dev/null cache_store_log /dev/null # Beberapa log yg tidak signifikan karena opsi2-nya jarang digunakan. log_fqdn off log_icp_queries off buffered_logs off emulate_httpd_log off ftp_list_width 32 ftp_passive on ftp_sanitycheck on # ini ip lan dan ip proxy acl localnet src 192.168.2.0/24 192.168.3.0/24 acl localnet src 192.168.12.0/24 uri_whitespace strip #DNS NAMESERVER # dns_nameservers gateway1 gateway-proxy dns_nameservers 192.168.1.1 192.168.3.1 cache_mem 8 MB maximum_object_size_in_memory 100 bytes memory_replacement_policy heap GDSF cache_replacement_policy heap LFUDA cache_dir aufs /cache 30000 70 256 minimum_object_size 0 bytes maximum_object_size 512 MB offline_mode off cache_swap_low 98 cache_swap_high 99 # Setup some default acls acl all src 0.0.0.0/0 acl localhost src 127.0.0.1/255.255.255.255 acl safeports port 21 70 80 81 210 280 443 488 563 591 631 777 901 3128 1025-65535 acl sslports port 443 563 81 acl manager proto cache_object acl purge method PURGE acl connect method CONNECT always_direct allow localnet localhost always_direct deny all http_access allow manager all http_access deny !safeports http_access deny CONNECT !sslports http_access allow purge localhost http_access deny purge # Always allow localhost connections http_access allow localhost # Allow local network(s) on interface(s) http_access allow localnet http_access deny all ================diragukan - tidak tau apa :D ================= #acl dynamic urlpath_regex cgi-bin \? #http_access deny manager http_reply_access allow all =========================================================== # header_access Accept-Encoding deny all # Default block all to be sure http_access deny all icp_access allow all miss_access allow localnet miss_access deny all visible_hostname proxy header_access X-Forwarded-For deny all #follow_x_forwarded_for allow localnet #follow_x_forwarded_for allow localhost #http_gzip on #http_gzip_types text/plain,text/html,text/xml,text/css,application/xml,application/xhtml+xml,application/rss+xml,application/javascript,application/x-javascript tcp_outgoing_tos 0x30 localnet zph_mode tos zph_local 0x30 zph_parent 0 zph_option 136 # DELAY POLL #acl admin src 192.168.88.100/32 # IP YG TDK KENA LIMIT #acl management src 192.168.88.101/32 # IP YG TIDAK KENA LIMIT #acl download url_regex -i \.avi$ \.mpg$ \.mpeg$ \.rm$ \.iso$ \.wav$ \.mov$ \.dat$ \.mpe$ \.mid$ \.flv$ \.3gp$ #acl download url_regex -i ftp \.exe$ \.mp3$ \.mp4$ \.tar.gz$ \.gz$ \.tar.bz2$ \.rpm$ \.zip$ \.rar$ #acl download url_regex -i \.midi$ \.rmi$ \.wma$ \.wmv$ \.ogg$ \.ogm$ \.m1v$ \.mp2$ \.mpa$ \.wax$ #acl download url_regex -i \.m3u$ \.asx$ \.wpl$ \.wmx$ \.dvr-ms$ \.snd$ \.au$ \.aif$ \.asf$ \.m2v$ #acl download url_regex -i \.m2p$ \.ts$ \.tp$ \.trp$ \.div$ \.divx$ \.mod$ \.vob$ \.aob$ \.dts$ #acl download url_regex -i \.ac3$ \.cda$ \.vro$ \.deb$ \.mkv$ #delay_pools 2 #delay_class 1 1 #delay_parameters 1 -1/-1 #delay_access 1 allow admin #delay_access 1 allow admin management #delay_access 1 deny all #delay_class 2 1 #delay_parameters 2 40000/5000000 #delay_access 2 allow download #delay_access 2 deny all # Caching Youtube acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\? acl videocache_allow_url url_regex -i \.youtube\.com\/videoplayback \.youtube\.com\/videoplay \.youtube\.com\/get_video\? acl videocache_allow_url url_regex -i \.youtube\.[a-z][a-z]\/videoplayback \.youtube\.[a-z][a-z]\/videoplay \.youtube\.[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 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 \.vimeo\.com\/(.*)\.(flv|mp4) 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 \.youporn\.com\/(.*)\.flv acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv acl videocache_allow_url url_regex -i \.tube8\.com\/(.*)\.(flv|3gp) acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flv acl videocache_allow_url url_regex -i \.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram|m4v) acl videocache_allow_url url_regex -i \.break\.com\/(.*)\.(flv|mp4) acl videocache_allow_url url_regex -i redtube\.com\/(.*)\.flv acl videocache_allow_dom dstdomain .mccont.com .metacafe.com .cdn.dailymotion.com acl videocache_deny_dom dstdomain .download.youporn.com .static.blip.tv acl dontrewrite url_regex redbot\.org \.php acl getmethod method GET storeurl_access deny dontrewrite storeurl_access deny !getmethod storeurl_access deny videocache_deny_dom storeurl_access allow videocache_allow_url storeurl_access allow videocache_allow_dom storeurl_access deny all storeurl_rewrite_program /etc/squid/storeurl.pl storeurl_rewrite_children 7 storeurl_rewrite_concurrency 10 # 1 year = 525600 mins, 1 month = 43200 mins, 1 day = 1440 refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern (get_video\?|videoplayback\?id|videoplayback.*id|videodownload\?|\.flv?) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern \.(ico|video-stats) 43200 999999% 43200 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\? 43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stale refresh_pattern galleries\.video(\?|sz) 43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stale refresh_pattern brazzers\? 43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stale refresh_pattern \.adtology\? 43200 999999% 43200 override-expire ignore-reload ignore-no-cache 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).* 43200 20% 43200 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 ^.*safebrowsing.*google 43200 999999% 43200 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) 43200 999999% 43200 override-expire ignore-reload ignore-private store-stale negative-ttl=10080 refresh_pattern ytimg\.com.*\.jpg 43200 999999% 43200 override-expire ignore-reload store-stale refresh_pattern images\.friendster\.com.*\.(png|gif) 43200 999999% 43200 override-expire ignore-reload store-stale refresh_pattern garena\.com 43200 999999% 43200 override-expire reload-into-ims store-stale refresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 43200 999999% 43200 override-expire ignore-reload store-stale refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\? 43200 999999% 43200 ignore-no-cache override-expire override-lastmod store-stale refresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 43200 999999% 43200 reload-into-ims override-expire ignore-private store-stale refresh_pattern ^http:\/\/images|pics|thumbs[0-9]\. 43200 999999% 43200 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stale refresh_pattern ^http:\/\/www.onemanga.com.*\/ 43200 999999% 43200 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stale refresh_pattern ^http://v\.okezone\.com/get_video\/([a-zA-Z0-9]) 43200 999999% 43200 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod ignore-must-revalidate negative-ttl=10080 store-stale # ANTI VIRUS refresh_pattern avast.com.*\.vpx 40320 50% 161280 store-stale reload-into-ims refresh_pattern (avgate|avira).*\.(idx|gz)$ 1440 90% 1440 ignore-reload ignore-no-cache ignore-no-store store-stale ignore-must-revalidate refresh_pattern kaspersky.*\.avc$ 5259487 999999% 5259487 ignore-reload store-stale refresh_pattern kaspersky 1440 50% 161280 ignore-no-cache store-stale refresh_pattern mbamupdates.com.*\.ref 1440 50% 161280 reload-into-ims store-stale refresh_pattern windowsupdate.com/.*\.(cab|exe) 10080 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern update.microsoft.com/.*\.(cab|exe) 10080 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern download.microsoft.com/.*\.(cab|exe) 10080 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale #images facebook refresh_pattern -i \.facebook.com.*\.(jpg|png|gif) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern -i \.fbcdn.net.*\.(jpg|gif|png|swf|mp3) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store 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 # 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 ignore-must-revalidate store-stale refresh_pattern -i \.farmville.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stale refresh_pattern -i \.ninjasaga.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stale refresh_pattern -i \.mafiawars.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stale refresh_pattern -i \.crowdstar.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stale refresh_pattern -i \.popcap.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stale #banner IIX refresh_pattern ^http:\/\/openx.*\.(jp(e?g|e|2)|gif|pn[pg]|swf|ico|css|tiff?) 129600 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/ads(1|2|3).kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/img.ads.kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern .kompasimages.com.*\.(jpg|gif|png|swf) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/openx.kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store 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 #All File #refresh_pattern -i \.(3gp|7z|ace|asx|bin|deb|divx|dvr-ms|ram|rpm|exe|inc|cab|qt) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-must-revalidate override-expire override-lastmod reload-into-ims store-stale #refresh_pattern -i \.(rar|jar|gz|tgz|bz2|iso|m1v|m2(v|p)|mo(d|v)|arj|lha|lzh|zip|tar) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-must-revalidate override-expire override-lastmod reload-into-ims store-stale #refresh_pattern -i \.(jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|dat|ad|txt|dll) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-must-revalidate override-expire override-lastmod reload-into-ims store-stale #refresh_pattern -i \.(avi|ac4|mp(e?g|a|e|1|2|3|4)|mk(a|v)|ms(i|u|p)|og(x|v|a|g)|rm|r(a|p)m|snd|vob) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-must-revalidate override-expire override-lastmod reload-into-ims store-stale #refresh_pattern -i \.(pp(t?x)|s|t)|pdf|rtf|wax|wm(a|v)|wmx|wpl|cb(r|z|t)|xl(s?x)|do(c?x)|flv|x-flv) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-must-revalidate override-expire override-lastmod reload-into-ims store-stale #refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 #refresh_pattern ^gopher: 1440 0% 1440 #refresh_pattern ^ftp: 10080 95% 43200 override-lastmod reload-into-ims store-stale #refresh_pattern . 00 95% 43200 override-lastmod reload-into-ims store-stale emulate_httpd_log off hosts_file /etc/hosts ### Objek-objek statis waktu peyimpanannya diperlama refresh_pattern -i \.(class|css|js|tif)(\?.*)?$ 1440 95% 100000080 reload-into-ims override-lastmod refresh_pattern -i \.(jpe|jpg|jpeg|png|bmp|gif)(\?.*)?$ 0 95% 1000000080 reload-into-ims override-lastmod refresh_pattern -i \.(tiff|mov|avi|qt|mpeg|3gp)(\?.*)?$ 0 95% 201600000 reload-into-ims override-lastmod refresh_pattern -i \.(mpg|mpe|wav|au|mid|flv)(\?.*)?$ 0 95% 2016000 reload-into-ims override-lastmod refresh_pattern -i \.(zip|gz|arj|lha|lzh)(\?.*)?$ 0 95% 2016000 reload-into-ims override-lastmod refresh_pattern -i \.(rar|tgz|tar|exe|bin)(\?.*)?$ 0 95% 2016000 reload-into-ims override-lastmod refresh_pattern -i \.(cab|psf|part|0*|swf|gz|grf|gpf)(\?.*)?$ 0 95% 2000160 reload-into-ims override-lastmod refresh_pattern -i \.(pdf|rtf|doc|swf|txt|inf)(\?.*)?$ 1 95% 2016000 reload-into-ims override-lastmod refresh_pattern -i \.(inc|cab|ad|hqx|dll)(\?.*)?$ 10080 95% 4320000 reload-into-ims override-lastmod refresh_pattern -i \.(asp|acgi|pl|shtml|php3|php)(\?.*)?$ 2 20% 432000 reload-into-ims override-lastmod refresh_pattern -i \.(ini)(\?.*)?$ 2 5% 10800 reload-into-ims override-lastmod refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern . 0 40% 40320 # SNMP snmp_port 3401 acl snmppublic snmp_community public snmp_access allow snmppublic localhost snmp_access deny all # TAG: Extra Tuning Configuration header_access Accept-Encoding deny all client_persistent_connections off server_persistent_connections on half_closed_clients off strip_query_terms off quick_abort_min 0 KB quick_abort_max 0 KB quick_abort_pct 100 vary_ignore_expire on reload_into_ims on pipeline_prefetch on range_offset_limit 512 KB read_timeout 30 minutes client_lifetime 6 hours negative_ttl 30 seconds positive_dns_ttl 6 hours negative_dns_ttl 60 seconds pconn_timeout 15 seconds request_timeout 1 minute store_avg_object_size 13 KB log_icp_queries off ipcache_size 1024 ipcache_low 98 ipcache_high 99 log_fqdn off fqdncache_size 1026 memory_pools off forwarded_for on logfile_rotate 3 store_dir_select_algorithm round-robin cache_effective_user proxy cache_effective_group proxy max_filedescriptors 8056 ##end of config

buat file storeurl.pl :
Code:
#!/usr/bin/perl # $Rev$ # by chudy_fernandez@yahoo.com # Updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion $|=1; while (<>) { @X = split; # $X[1] =~ s/&sig=.*//; $x = $X[0] . " "; $_ = $X[1]; $u = $X[1]; # compatibility for old cached get_video?video_id if (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 HD itag=22 } elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&(itag=22).*?\&(id=[a-zA-Z0-9]*)/) { print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $2 . "&" . $3 . "\n"; # youtube Normal screen always HD itag 35, Normal screen never HD itag 34, itag=18 <--normal? } elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&(itag=[0-9]*).*?\&(id=[a-zA-Z0-9]*)/) { print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $3 . "\n"; } 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]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) { print $x . "http://cdn." . $3 . $5 . "\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"; #general purpose for cdn servers. add above your specific servers. } elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) { print $x . "http://squid-cdn-url//" . $2 . "." . $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"; #generic http://variable.domain.com/path/filename."ext" or "exte" with or withour "?" } elsif (m/^http:\/\/(.*)([^\.\-]*?\..*?)\/(.*)\.([^\/\?\&]{3,4})(\?.*)?$/) { @y = ($1,$2,$3,$4); $y[0] =~ s/(([a-zA-A-]+[0-9-]+)|(.*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 . $_ . "\n"; } }

berikan hak ases user : proxy dan group : proxy untuk directory /cache (sesuaikan dengan partisi cache squid ada berapa) dan storeurl.pl dan berikan permission execute :
Code:
# chown proxy:proxy /cache # chmod 777 /cache # chown proxy:proxy /etc/squid/storeurl.pl # chmod 777 /etc/squid/storeurl.pl

buat folder-folder swap/cache di dalam folder cache yang telah ditentukan dengan perintah :
Code:
# squid -f /etc/squid/squid.conf -z

untuk stop service gunakan :
Code:
# /etc/init.d/squid stop

klo untuk start : (ga tau kenapa)
Code:
# service squid start
jangan asal copas tanpa meninggalkan jejak Takut, jangan main comot n ngaku punya sendiri , g malu apa SantetMarah
mohon koreksi dan caci makinya ya para senior LoveLove

kalau ingin digabungkan dengan mikrotik, tambahkan :
Code:
/ip firewall nat add chain=dstnat action=dst-nat to-addresses=192.168.3.3 to-ports=3128 protocol=tcp src-address=!192.168.3.0/24 src-address-list=ip-address-lan dst-address-list=!192.168.0.0/16 in-interface=local dst-port=80,81,8080,3128 comment=TRANSPARANT-PROXY-HIT-LAN

192.168.3.3 = ip proxy
192.168.3.0/24 = network proxy
192.168.0.0/16 = dipakai gini agar tidak looping (mutar2 gitu, biar g pusing Piktor)
80,81,8080,3128 = port ini yang akan dibelokkan ke squid dari mikrotik
3128 = port proxy squid
! artinya selain

monggo komentarnya juragan2,,CheerBahagia
Reply
#2
wah sip sip tambah ilmu, keep share bang Smile
Reply
#3
(07-03-2012, 03:15 AM)Gen Wrote: wah sip sip tambah ilmu, keep share bang Smile

ayoo2 dicoba gan, mana tau ada tambahan
Reply
#4
Need for windows ia.. soalnya lagi g pake linux.. But :Smile: kapan tak coba dilinux..
Code:
Need teman yang bisa C#,C++,Net,Java,HTML5 Application/Games untuk di ajak kerjasama membangun startup , silahkan PM ;) :bahagia:
Reply
#5
kalau di squid 3.0 confignya agak beda ya bang? Bingung
Reply
#6
(07-06-2012, 05:10 AM)adecakep7 Wrote: Need for windows ia.. soalnya lagi g pake linux.. But :Smile: kapan tak coba dilinux..

ini link buat windows gan
tapi klo buat warnet atau buat hotsepot baiknya ya pakai linux
soalnya klo banyak user yang akses squid (klo serpernya windows nih ye), bakal g bernyawa tuh windows

linux yang desktop aja klo dipakai banyak user, lola juga Garing

(07-06-2012, 05:21 AM)Gen Wrote: kalau di squid 3.0 confignya agak beda ya bang? Bingung
iya gan, pakainya linux apa?
itu yang di buat file "squid" di /etc/init.d/ cuma buat ubuntu 10.04
soalnya ada bugnya Santet
klo yang lain, lewatkan aja prosesnya

tapi klopun pakai squid 3, klo kagak bisa pidiocache kagak ada artinya juga, sama aja boong, diatas kan udah bisa pidiocache PiktorPiktor
Reply
#7
IJIN NYIMAK GAN... SEKALIAN NYOBA YAK>> HEHEHE
Reply
#8
bookmark dulu aja gan, soalnya masi pake windows Mentok

kalo udah ntar ane coba wakaka
nice share Culas
Reply
#9
waw Mantep main Linux gan...


Coding terus :D

Hehehehe :GANTENG:
Reply
#10
boleh minta squid.conf nya ngga? punya saya nge-HIT mulu nih.

masa ngga ada internet masih bisa buka google.. Mentok
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [share] Kumpulan DNS newbie-herbet 16 482 01-26-2014, 07:06 AM
Last Post: finder
Electric_16 Tutorial Konfigurasi SSL-VPN Di Fortigate E1nzte1N 0 62 01-25-2014, 12:01 PM
Last Post: E1nzte1N
  [SHARE] Pengertian Port dan Fungsi Port arafahcom 2 90 07-06-2013, 12:18 AM
Last Post: arafahcom
Heart_16 [Share] Jadikan laptop sbg AP Zeldak 20 497 07-05-2013, 06:59 PM
Last Post: arafahcom
  [SHARE]ebook gratis network & security If_ 4 182 07-05-2013, 11:41 AM
Last Post: HeKeL_nEwBiE
  [SHARE] VPN ,Speed wus wus, Unlimited Bandwidth r14nul 14 732 05-03-2013, 09:44 PM
Last Post: marliandojr
  [SHARE] Fungsi Dari NETWORK LAYER ACESS & INTERNET LAYER Pada TCP/IP Bet0 7 186 01-15-2013, 09:40 PM
Last Post: Bet0
  newbie butuh bantuan alfrazi13 13 156 11-25-2012, 01:56 PM
Last Post: arjuna
Death_16 Newbie Butuh Bantuan V4l 13 208 11-24-2012, 01:14 PM
Last Post: 777r
  Share cara Instalasi Kabel F.O ( Fiber Optik ) sayed 5 177 09-26-2012, 07:36 PM
Last Post: cR0t

Forum Jump:


Users browsing this thread: 1 Guest(s)