Barusan dapat dari Forum Mikrotik, Setting Proxy Ubuntu server 10.10 64 bit, dengan menggunakan squid 2.7 stable 9 Whith pacth video cache, lumayan bisa cache video youtube dan yang pasti sudah saya test kehebatannya di warnet yang saya kelola , ok kita langsung saja ;
Speck yang saya gunakan:
HD 80 Gb sata
Prosessor intel pentium 4.3
ram 1 Gb ddr 2
Langkah demi langkah ;
- bebaskan semua hubungan ke cpu ke internet
- masukkan CD ubuntu ke dalam CD room laku lakukan reboot untuk memulai booting via CD room
- pilih linguage english ( enter )
- pilih instal ubuntu server ( enter )
- tekan enter pada chaoos linguage english
- pilih united states
- klik no pada detect keyboard layout
- kilk USA pada ubuntu installer main menu
- klik USA pada keyboard layout
- klik continue pada configuere the network
- pilih configure network manually dan isikan ip address dengan 192.168.1.10( ip untuk proxy ) pilih continue lalu enter
- netmark 255.255.255.0 pilih continue enter
- gatway 192.168.1.1 terus kilk continue
- name server address 192.168.1.1 pilih continue enter
- hostname : isi dengan proxyku terus pilih continue enter
- domain name di kosongin saja, pilih continue enter
- pada configure the clock pilih select worldwide list terus cari jakarta kemudian enter
- Pada menu partition disk pilih manual
- Kita hapus partisi lama dulu :
- Pilih partisi nya terus enter pilih delete the partion (ulangi perintah ini untuk semua partisi yg tersisa)
- Jika telah selesai pilih Guided partitioning, kemudian pilih manual arahkan pada FREE SPACE (enter),
- Pilih Create new partition (enter)
- New partition size isi 20 GB/40% dari hardisc (pilih continue dan enter), pilih Primary (enter), pilih Beginning (enter), pada use as pilih EXT4 (enter) pada Mount point pilih / (enter), pd mount option pilih[*] noatime (pilih continue dan enter), kemudian pilih done setting up the partition
- Arahkan pada FREE SPACE (enter), pilih Create new partition (enter) new partition size isi 1 gb sesuai kan dg besaran RAM (pilih continue dan enter), pilih Primary (enter), pilih Beginning (enter), pada use as pilih swap area (enter), kemudian Pilih done setting up the partition
- Arahkan pada FREE SPACE (enter),
pilih Create new partition (enter) new partition size isi sisa semua harddisk (pilih continue dan enter), pilih Primary (enter), pilih Beginning (enter), pada use as pilih btrFS (enter), pada Moun point enter manually buat menjadi /cache, pd mount option pilih[*] noatime kemudian Pilih continue dan done setting up the partition - Kemudian pilih finis partitioning and write changes to disk, write the changes to disk pilih yes
- pada full name for the new user isi dg proxyku, terus continue & enter
- pada Username for your account isi dg proxyku, terus continue & enter
- pada a password for the new user isi dg proxyku, terus continue & enter
- pada re-enter password to verify isi dg proxyku, terus continue & enter
- pada use weak password pilih yes
- pada encrypt your home directory pilih no
- pada HTTP proxy information KOSONGIN SAJA
- pada configurasi apt 43% tekan enter ( untuk Skip biar cpt ), juga pada 81% ( untuk Skip biar cpt )tekan enter
pilih no automatic update - pada choose software to install pilih OpenSSH server
pilih continus pd finis the installation dan restart
Install Paket yg di butuhkan ( CPU harap di hubungkan ke Internet)
mulai bekerja menggunakan putty via windows ok siapkan puttynya di windows
# login ke proxy via putty
# masukkan username proxyku
# password proxyku
# ketik sudo su
# ketik passwd proxyku
# ketik sudo su
# ketik passwd proxyku
sekarang kita mulai bekerja pada tahap penginstallan
# Lakukan update apt-get di bawah ini ;
sudo apt-get update
sudo apt-get install squid squidclient squid-cgi
sudo apt-get install gcc
sudo apt-get install build-essential
sudo apt-get install sharutils
sudo apt-get install ccze
sudo apt-get install libzip-dev
sudo apt-get install automake1.9
# Download Squid 7 Stable 9 di sini :
wget http://untuk-kamu.googlecode.com/files/squid-2.7.STABLE9%2Bpatch.tar.gz
tar xvf squid-2.7.STABLE9+patch.tar.gz
cd squid-2.7.STABLE9
tar xvf squid-2.7.STABLE9+patch.tar.gz
cd squid-2.7.STABLE9
# lakukan tahap compile nya :
./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
Kemudia:
make
sudo make install
sudo make install
sampai disini squid sudah terinstal di mesin proxy ok Lanjut..yukk ....
Siap pengEditan Squid.conf
#Stop Squid sudo /etc/init.d/squid stop
agar perintah sudo /etc/init.d/squid stop jalan di ubuntu 10.10,
Copy file squid di bawah ini ke /etc/init.d/
caranya ketik :
nano /etc/init.d/squid
PASTE FILE DI BAWAH INI
#! /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"
}
setelah selesai tekan crtl+x kemudian yes,
ok file /etc/init.d/squid sudah kita bikin, agar file yg kita bikin tadi bisa bekerja maka kita harus memberikan permisi direktory pada file tersebut dengan perintah:
chown proxy:proxy /etc/init.d/squid
chmod 777 /etc/init.d/squid
sekarang proxy sudah bisa di stop dengan perintah
sudo /etc/init.d/squid stop
bila sudah di stop, saatnya kita mengedit squid.conf nya... caranya
1. beck up file asli squid.conf dengan perintah
mv /etc/squid/squid.conf /etc/squid/squid.conf.asli
2. Creat config squid baru
nano /etc/squid/squid.conf
Lalu paste dan sesuaikan dengan network anda file config squid di bawah
##start of confighttp_port 3128 transparentserver_http11 onicp_port 0# File Squidpid_filename /var/run/squid.pidcoredump_dir /var/spool/squid/error_directory /usr/share/squid/errors/en/icon_directory /usr/share/squid/iconsmime_table /usr/share/squid/mime.confvisible_hostname beben-dayak# Log Squidaccess_log /var/log/squid/access.logcache_log /dev/nullcache_store_log /dev/null# Beberapa log yg tidak signifikan karena opsi2-nya jarang digunakan.log_fqdn offlog_icp_queries offbuffered_logs offemulate_httpd_log offftp_list_width 32ftp_passive onftp_sanitycheck onacl localnet src 192.168.10.0/24 # ------ >> GANTI DGN IP LAN JURAGANacl localnet src 192.168.12.0/24uri_whitespace strip#DNS NAMESERVERdns_nameservers 192.168.1.1 192.168.5.1 # ------->> GANTI DG GATEWAI PROXY NYAcache_mem 8 MBmaximum_object_size_in_memory 100 bytesmemory_replacement_policy heap GDSFcache_replacement_policy heap LFUDAcache_dir aufs /cache 30000 70 256minimum_object_size 0 bytesmaximum_object_size 512 MBoffline_mode offcache_swap_low 98cache_swap_high 99# Setup some default aclsacl all src 0.0.0.0/0acl localhost src 127.0.0.1/32acl safeports port 21 70 80 81 210 280 443 488 563 591 631 777 901 3128 1025-65535acl sslports port 443 563 81acl manager proto cache_objectacl purge method PURGEacl connect method CONNECTacl dynamic urlpath_regex cgi-bin \?http_access allow manager localhosthttp_access deny managerhttp_access allow purge localhosthttp_access deny purgehttp_access deny !safeportshttp_access deny CONNECT !sslports# Always allow localhost connectionshttp_access allow localhost# Allow local network(s) on interface(s)http_access allow localnet# Default block all to be surehttp_access deny allheader_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-javascripttcp_outgoing_tos 0x30 localnetzph_mode toszph_local 0x30zph_parent 0zph_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 Youtubeacl 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\/(.*)flvacl 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\/(.*)\.flvacl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flvacl videocache_allow_url url_regex -i \.tube8\.com\/(.*)\.(flv|3gp)acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flvacl 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\/(.*)\.flvacl videocache_allow_dom dstdomain .mccont.com .metacafe.com .cdn.dailymotion.comacl videocache_deny_dom dstdomain .download.youporn.com .static.blip.tvacl dontrewrite url_regex redbot\.org \.phpacl getmethod method GETstoreurl_access deny dontrewritestoreurl_access deny !getmethodstoreurl_access deny videocache_deny_domstoreurl_access allow videocache_allow_urlstoreurl_access allow videocache_allow_domstoreurl_access deny allstoreurl_rewrite_program /etc/squid/storeurl.plstoreurl_rewrite_children 7storeurl_rewrite_concurrency 10# 1 year = 525600 mins, 1 month = 43200 mins, 1 day = 1440refresh_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-stalerefresh_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-stalerefresh_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-stalerefresh_pattern \.etology\? 43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stalerefresh_pattern galleries\.video(\?|sz) 43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stalerefresh_pattern brazzers\? 43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stalerefresh_pattern \.adtology\? 43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stalerefresh_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=10refresh_pattern ^.*safebrowsing.*google 43200 999999% 43200 override-expire ignore-reload ignore-no-cache ignore-private ignore-auth ignore-must-revalidate negative-ttl=10080 store-stalerefresh_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=10080refresh_pattern ytimg\.com.*\.jpg 43200 999999% 43200 override-expire ignore-reload store-stalerefresh_pattern images\.friendster\.com.*\.(png|gif) 43200 999999% 43200 override-expire ignore-reload store-stalerefresh_pattern garena\.com 43200 999999% 43200 override-expire reload-into-ims store-stalerefresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 43200 999999% 43200 override-expire ignore-reload store-stalerefresh_pattern vid\.akm\.dailymotion\.com.*\.on2\? 43200 999999% 43200 ignore-no-cache override-expire override-lastmod store-stalerefresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 43200 999999% 43200 reload-into-ims override-expire ignore-private store-stalerefresh_pattern ^http:\/\/images|pics|thumbs[0-9]\. 43200 999999% 43200 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stalerefresh_pattern ^http:\/\/www.onemanga.com.*\/ 43200 999999% 43200 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stalerefresh_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 VIRUSrefresh_pattern avast.com.*\.vpx 40320 50% 161280 store-stale reload-into-imsrefresh_pattern (avgate|avira).*\.(idx|gz)$ 1440 90% 1440 ignore-reload ignore-no-cache ignore-no-store store-stale ignore-must-revalidaterefresh_pattern kaspersky.*\.avc$ 5259487 999999% 5259487 ignore-reload store-stalerefresh_pattern kaspersky 1440 50% 161280 ignore-no-cache store-stalerefresh_pattern mbamupdates.com.*\.ref 1440 50% 161280 reload-into-ims store-stalerefresh_pattern windowsupdate.com/.*\.(cab|exe) 10080 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stalerefresh_pattern update.microsoft.com/.*\.(cab|exe) 10080 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stalerefresh_pattern download.microsoft.com/.*\.(cab|exe) 10080 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale#images facebookrefresh_pattern -i \.facebook.com.*\.(jpg|png|gif) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stalerefresh_pattern -i \.fbcdn.net.*\.(jpg|gif|png|swf|mp3) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stalerefresh_pattern static\.ak\.fbcdn\.net*\.(jpg|gif|png) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stalerefresh_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 facebookrefresh_pattern ^http:\/\/apps.facebook.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store store-stalerefresh_pattern -i \.zynga.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stalerefresh_pattern -i \.farmville.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stalerefresh_pattern -i \.ninjasaga.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stalerefresh_pattern -i \.mafiawars.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stalerefresh_pattern -i \.crowdstar.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stalerefresh_pattern -i \.popcap.com.*\/ 10080 999999% 43200 ignore-reload override-expire ignore-no-cache ignore-no-store ignore-must-revalidate store-stale#banner IIXrefresh_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-stalerefresh_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-stalerefresh_pattern ^http:\/\/img.ads.kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stalerefresh_pattern .kompasimages.com.*\.(jpg|gif|png|swf) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stalerefresh_pattern ^http:\/\/openx.kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale#IIX DOWNLOADrefresh_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-staleemulate_httpd_log offhosts_file /etc/hosts### Objek-objek statis waktu peyimpanannya diperlamarefresh_pattern -i \.(class|css|js|tif)(\?.*)?$ 1440 95% 100000080 reload-into-ims override-lastmodrefresh_pattern -i \.(jpe|jpg|jpeg|png|bmp|gif)(\?.*)?$ 0 95% 1000000080 reload-into-ims override-lastmodrefresh_pattern -i \.(tiff|mov|avi|qt|mpeg|3gp)(\?.*)?$ 0 95% 201600000 reload-into-ims override-lastmodrefresh_pattern -i \.(mpg|mpe|wav|au|mid|flv)(\?.*)?$ 0 95% 2016000 reload-into-ims override-lastmodrefresh_pattern -i \.(zip|gz|arj|lha|lzh)(\?.*)?$ 0 95% 2016000 reload-into-ims override-lastmodrefresh_pattern -i \.(rar|tgz|tar|exe|bin)(\?.*)?$ 0 95% 2016000 reload-into-ims override-lastmodrefresh_pattern -i \.(cab|psf|part|0*|swf|gz|grf|gpf)(\?.*)?$ 0 95% 2000160 reload-into-ims override-lastmodrefresh_pattern -i \.(pdf|rtf|doc|swf|txt|inf)(\?.*)?$ 1 95% 2016000 reload-into-ims override-lastmodrefresh_pattern -i \.(inc|cab|ad|hqx|dll)(\?.*)?$ 10080 95% 4320000 reload-into-ims override-lastmodrefresh_pattern -i \.(asp|acgi|pl|shtml|php3|php)(\?.*)?$ 2 20% 432000 reload-into-ims override-lastmodrefresh_pattern -i \.(ini)(\?.*)?$ 2 5% 10800 reload-into-ims override-lastmodrefresh_pattern ^ftp: 1440 20% 10080refresh_pattern ^gopher: 1440 0% 1440refresh_pattern . 0 40% 40320# SNMPsnmp_port 3401acl snmppublic snmp_community publicsnmp_access allow snmppublic localhostsnmp_access deny all# TAG: Extra Tuning Configurationheader_access Accept-Encoding deny allclient_persistent_connections offserver_persistent_connections onhalf_closed_clients offstrip_query_terms offquick_abort_min 0 KBquick_abort_max 0 KBquick_abort_pct 100vary_ignore_expire onreload_into_ims onpipeline_prefetch onrange_offset_limit 512 KBread_timeout 30 minutesclient_lifetime 6 hoursnegative_ttl 30 secondspositive_dns_ttl 6 hoursnegative_dns_ttl 60 secondspconn_timeout 15 secondsrequest_timeout 1 minutestore_avg_object_size 13 KBlog_icp_queries offipcache_size 1024ipcache_low 98ipcache_high 99log_fqdn offfqdncache_size 1026memory_pools offforwarded_for onlogfile_rotate 3store_dir_select_algorithm round-robincache_effective_user proxycache_effective_group proxymax_filedescriptors 8056##end of config
**EDIT IP YANG DI TANDAI # -------------------- PADA SQUID CONF SESUAIKAN DENGAN NETWORK lan JURAGAN
setelah selesai tekan crtl+x lalu yes.
ok sekarang squid.conf anda yang baru sudah selesai
3. creat file storeurl.pl ( untuk video cache )
nano /etc/squid/storeurl.pl
lalu paste config storeurl.pl di bawah ini
#!/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/;×tamp=[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";
}
}
setelah selesai tekan crtl+x lalu yes.
ok sekarang storeurl.pl anda sudah selesai
Hmmm Squid.conf Dan Storeurl.pl udah ada sekarang tinggal mengaktifkan Squid.conf,storeurl.pl dan creat cache di rektory dengan perintah
chown proxy:proxy /cachechmod 777 /cache
ok jalan kan squid Now
/etc/init.d/squid restart
Misal ip untuk proxy dengan gatway dari mikrotik dengan ip 192.168.1.1 dan ip proxy 192.168.1.10
SET nat masquerade untuk gatway proxy :
chain=srcnat action=masquerade src-address=192.168.1.0/24
Transparant proxy :
chain=dstnat action=dst-nat to-addresses=192.168.1.10 to-ports=3128 protocol=tcp src-address=!192.168.1.10 dst-port=80
Reboot CPU Ubuntu, TAMAT.
Sumber : http://www.lintaskapuas.co.cc/2010/11/proxy-ubuntu-1010-64-bit-dengan-squid.html#ixzz1KES9u0Cu
0 comments:
Posting Komentar