Rabu, 13 Oktober 2010

SQUID PROXY

Buat anda yang memiliki jaringan internet dengan koneksi seadanya dan pengen menghemat bandwith koneksi internet dan sekaligus mempercepatnya. Kok bisa ya cepat tapi hemat bandwith. Squid sebenarnya adalah program yang dikembangkan dalam dunia Linux yang bekerja efektif mengelola file temporer. Pada awalnya squid dikembangkan untuk mengelola file temporary pada platform Linux. Cara kerjanya yakni dengan otomatis menyimpan semua file yang kita download saat mengakses situs di dalam satu file temporer yang disebut cache. Di sana semua konten, alamat, teks, gambar dan halaman web disimpan. Pada saat kita mengakses situs untuk pertama kali, squid akan secara otomatis menyimpannya dan membuat link bayangan agar saat halaman yang sama dibuka untuk kedua kali, browser tidak langsung mendownload dari situs aslinya. Melainkan mendownload dari cache squid yang sebenarnya ada di komputer kita. Sehingga halaman web akan lebih cepat terbuka. Jika kita sering membuka halaman yang sama, prosesnya akan jauh lebih cepat saat kedua kali dan seterusnya.
Begini analoginya
saya langsung berikan contoh real saya membuka situs jejaring social facebook dengan kapsitas halaman 775kb. Dalam proses standar, semua file ini akan disimpan dalam file temporer browser yang seharusnya bisa kita gunakan lagi tapi pada prakteknya tiap kita membuka halaman yang sama kita tetap mendownload file yang sama berulang kali. Nah bayangkan jika kita membuka membuka facebook 10 kali (775KB x 10 = 7.75Mb) atau reload page berulang-ulang berapa bandwith yang terpakai dan berapa lama lagi kita tunggu redownloadnya nah kira-kira begitu ceritanya.

download squid standar
download squid costum

Cara instalasi ( versi standar)
Ekstrak file squid
copy folder ke :C ( untuk memudahkan saja waktu bat cmd)
Lihat dan perhatikan isi folder Squid>etc>. Disana ada beberapa file konfigurasi default squi
sebagai berikut:
- cachemgr.conf.default
- mime.conf.default
- squid.conf.default
- squid_radius_auth.conf.default

rename menjadi
- cachemgr.conf
- mime.conf
- squid.conf
- squid_radius_auth.conf

buka file squid.conf dengan notepad Temukan tulisan TAG: http_port. denagn menekan Cntrl + F, pastikan di bagian bawah TAG ini sudah ada tulisan http_port 3128 sehingga tampak seperti berikut:

#  TAG: http_port
#    Usage:    port [options]
#        hostname:port [options]
#        1.2.3.4:port [options]
#
#    The socket addresses where Squid will listen for HTTP client
#    requests.  You may specify multiple socket addresses.
#    There are three forms: port alone, hostname with port, and
#    IP address with port.  If you specify a hostname or IP
#    address, Squid binds the socket to that specific
#    address.  This replaces the old 'tcp_incoming_address'
#    option.  Most likely, you do not need to bind to a specific
#    address, so you can use the port number alone.
sampai line
#    If you run Squid on a dual-homed machine with an internal
#    and an external interface we recommend you to specify the
#    internal address:port in http_port. This way Squid will only be
#    visible on the internal address.
#
# Squid normally listens to port 3128
http_port 3128



Temukan TAG: visible_hostname, tambahkan tulisan visible_hostname localhost di bagian bawah tag ini. Anda boleh menghapus tulisan # none. sehingga tampak seperti berikut:

# TAG: visible_hostname
# If you want to present a special hostname in error messages, etc,
# define this. Otherwise, the return value of gethostname()
# will be used. If you have multiple caches in a cluster and
# get errors about IP-forwarding you must set them to have individual
# names with this setting.
#
#Default:
visible_hostname localhost

Temukan http_access allow localnet. Tambahkan http_access allow localhost di bawahnya sehingga menjadi:
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

Temukan TAG: dns_nameservers, pada tulisan dns_nameservers. Pada bagian bawah tag ini, isi dengan alamat DNS dari ISP yang Anda gunakan dengan format dns_nameservers [primary DNS] [secondary DNS].
#  TAG: dns_nameservers
#    Use this if you want to specify a list of DNS name servers
#    (IP addresses) to use instead of those given in your
#    /etc/resolv.conf file.
#    On Windows platforms, if no value is specified here or in
#    the /etc/resolv.conf file, the list of DNS name servers are
#    taken from the Windows registry, both static and dynamic DHCP
#    configurations are supported.
#
# Example: dns_nameservers 10.0.0.1 192.172.0.4
dns_nameservers 202.134.0.155 202.134.1.10



DNS dapat diganti dengan DNS favorit anda
Simpan file tersebut

untuk versi costum anda dapat langsung kelangkah dibawah ini. (DNS saya isikan 202.134.0.155 202.134.1.10) anda dapat mengantinya dengan :
OpenDNS :
    * 208.67.222.222
    * 208.67.220.220
telkom.net.id :
202.155.0.20
    * 202.155.0.15
    * 202.134.0.62
    * 202.134.0.155
    * 202.134.1.10
    * 202.134.2.5
    * 203.130.196.5
    * 203.130.209.242
cbn.net.id
    * 202.158.40.1
    * 202.158.20.1
indo.net.id
    * 202.159.32.2
    * 202.159.33.2
indosat.net.id
    * 202.155.0.20
    * 202.155.0.15
    * 202.155.30.227
itb.ac.id
    * 202.249.24.65
    * 167.205.23.1
    * 167.205.22.123
    * 167.205.30.114
ukdw.ac.id
    * 222.124.22.18
sat.net.id
    * 202.149.82.25
    * 202.149.82.29

untuk lebih enaknya ping dulu DNS tercepat

Langkah selanjutnya Instalasi ke system
Masuk ke Start > Run > CMD
pada commant prompt ketik cd C:\squid\sbin lalu tekan enter maka tampilannya akan seperti ini


squid -z tekan enter

Jika muncul pesan pop up Windows Security Alert seperti gambar di samping, pilih Unblock untuk memberi akses kepada instalasi Squid Proxy.jika security center anda tidak aktif maka pop up ini tidak muncul


squid -d 1 -D tekan enter
tunggu beberapa saat kemudian tekan CTRL + C
squid -i tekan enter
squid -O -D tekan enter

kemudian menjalankan program squid
Start> Run> services.msc
Cari services "Squid", kemudian klik kanan dan "Start"
setting proxy browser 127.0.0.1 port 3128

Squid sudah berjalan pada PC anda
NOTE :
Secara default Squid akan menjalankan proses sendiri tiap kali PC melakukan restart. Cache  squid  ini disimpan dalam folder c:\squid\var\cache. Untuk melihat log file squid proxy, Anda bisa mengetikkan:   
more c:\squid\var\logs\access.log tekan enter

Untuk uninstal Squid
Masuk ke Start > Run > CMD
pada command prompt
cd C:\squid\sbin tekan enter
squid -r tekan enter
setting ulang network browser anda No proxy

Internet anda berjalan sekarang mode default

Link download fixed

1 komentar:

LEARNING mengatakan...

mangtabs broe..... jempol 100 boeat hemoll

Posting Komentar