Selasa, 19 April 2011

Mempercepat Koneksi Internet Dan Menghemat Bandwidth IM2 Di Windows Menggunakan Squid Server Proxy




Bagaimana Cara -Mempercepat Koneksi Internet Dan Menghemat Bandwidth IM2 Di Windows Menggunakan Squid Server Proxy



Squid di linux emank sudah gag asing tentunya, tapi gimana lok pake windows? Hmm perlu de di coba.
Nah, di sini aku mw sharing ma temen-temen, koneksi internet aku di kost kan menggunakan Indosat M2 di share jadi bertiga. Untuk mensiasati agar koneksi berjalan seolah-olah rada cepat. Aku gunain sebuah proxy di komputer server aku, bagi yang belum baca gimana aku sharing indosat M2, silakan baca ini.
Selain mempercepat penyampaian web content, cara ini juga untuk menghemat quota bandwidth dari provider Indosat M2 yang di batasi hanya 2 GB. Bagaimana tidak, setiap request yang dilakukan user di cek terlebih dahulu di server proxy, apakah datanya ada atau tidak, jika ada tinggal di ambilkan di server proxy, lok gag ada baru ambil dari internet.
Ok langkah untuk memasang squid di windows tentu saja dengan download Squid untuk windows. Silahkan download di sini.
Ekstrak file hasil donlotan tadi di C:\squid\

Setelah itu masuk ke dalam direktori C:\squid\etc.

Di sana anda akan menemui 4 buah file yaitu:

  1. cachemgr.conf.default
  2. mime.conf.default
  3. squid.conf.default
  4. squid_radius_auth.conf.default
Setelah itu ubah tulisan default pada semua file menjadi
  1. cachemgr.conf
  2. mime.conf
  3. squid.conf
  4. squid_radius_auth.conf
Buka teks editor kesayangan anda, bisa gunakan notepad++, buka file squid.conf. Kemudian cari parameter-parameter berikut ini :
  1. TAG: http_portPort ini akan digunakan oleh squid. Port defaultnya adalah 3128. Kamu masukin http_port 3128 di bawah tulisan # Squid normally listens to port 3128. Ex:
    # TAG: http_port
    # Usage: port [options]
    # hostname:port [options]
    # 1.2.3.4:port [options]
    #
    ................................
    #
    # Squid normally listens to port 3128
    http_port 3128
  2. TAG: visible_hostnameDigunakan untuk menampilkan nama yang digunakan ketika terjadi pesan kesalahan. Tambahkan tulisan visible_hostname di bawah tulisan none, seperti di bawah ini.
    # 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:
    # none
    visible_hostname kostblogger.com
  3. Tag: http_access
    Menambahkan http_access allow localhost, dimaksudkan untuk membuat agar komputer server proxy dapat mengakses proxy yang dipasang pada dirinya. Tambahkan di bawah localnet. # TAG: http_access
    # Allowing or Denying access based on defined access lists
    #
    # Accessi to the HTTP port:
    # http_access allow|deny [!]aclname ...
    #
    # NOTE on default values:
    #
    # If there are no "access" lines present, the default is to deny
    # the request.
    #
    # If none of the "access" lines cause a match, the default is the
    # opposite of the last line in the list. If the last line was
    # deny, the default is allow. Conversely, if the last line
    # is allow, the default will be deny. For these reasons, it is a
    # good idea to have an "deny all" or "allow all" entry at the end
    # of your access lists to avoid potential confusion.
    #
    #Default:
    # http_access deny all
    #
    #Recommended minimum configuration:
    #
    ..................................................
    # 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
  4. TAG: dns_nameserversUntuk mencari tau berapa DNS kita di windows, gunakan command ipconfig /allpada command prompt. Kemudian cari DNS servernya. Kemudian masukkan DNS server yang didapat dari command tadi dengan format dns_nameserver [primary] [secondary] # 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
    #
    #Default:
    # none
    dns_nameservers 202.155.0.10 202.155.0.15
  5. Tag: cache_memDigunakan untuk menentukan besarnya cache memory yang akan digunakan oleh squid untuk melakukan caching object. Sebaiknya nilainya 1/3 dari total keseluruhan RAM. Dan ukuran ini akan digunakan oleh squid sebagai batas maksimal penggunaan memory. # TAG: cache_mem (bytes)
    #
    ..........................................
    # If circumstances require, this limit will be exceeded.
    # Specifically, if your incoming request rate requires more than
    # 'cache_mem' of memory to hold in-transit objects, Squid will
    # exceed this limit to satisfy the new requests. When the load
    # decreases, blocks will be freed until the high-water mark is
    # reached. Thereafter, blocks will be used to store hot
    # objects.
    #
    #Default:
    # cache_mem 8 MB
    cache_mem 64 MB
  6. Tag: maximum_object_size_in_memoryMenentukan besar maksimal object yang akan di-caching pada memory. Object yang lebih besar dari nilainya tidak akan dicache oleh squid. #  TAG: maximum_object_size_in_memory    (bytes)
    #    Objects greater than this size will not be attempted to kept in
    #    the memory cache. This should be set high enough to keep objects
    #    accessed frequently in memory to improve performance whilst low
    #    enough to keep larger objects from hoarding cache_mem.
    #
    #Default:
    # maximum_object_size_in_memory 8 KB
    maximum_object_size_in_memory 1024 KB
  7. Tag: maximum_object_sizeMenentukan besarnya object yang akan disimpan di harddisk. # TAG: maximum_object_size (bytes)
    # Objects larger than this size will NOT be saved on disk. The
    # value is specified in kilobytes, and the default is 4MB. If
    # you wish to get a high BYTES hit ratio, you should probably
    # increase this (one 32 MB object hit counts for 3200 10KB
    # hits). If you wish to increase speed more than your want to
    # save bandwidth you should leave this low.
    #
    # NOTE: if using the LFUDA replacement policy you should increase
    # this value to maximize the byte hit rate improvement of LFUDA!
    # See replacement_policy below for a discussion of this policy.
    #
    #Default:
    # maximum_object_size 4096 KB
    maximum_object_size 4096 KB
  8. Tag: minimum_object_sizeDigunakan untuk menentukan besarnya file minimum yang akan disimpan di dalam harddisk. # TAG: minimum_object_size (bytes)
    # Objects smaller than this size will NOT be saved on disk. The
    # value is specified in kilobytes, and the default is 0 KB, which
    # means there is no minimum.
    #
    #Default:
    # minimum_object_size 0 KB
    minimum_object_size 0 KB
  9. Buka "Command Prompt", kemudian masuk ke directory "squid" tadi melalui "Command Prompt". Contohnya adalah dengan mengetik "cd C:\squid\sbin\"
  10. Setelah masuk ke dalam direktori sbin, ketikkan perintah "squid -z". Perintah ini digunakan untuk membuat direktori cache_dir.
  11. Kemudian ketik "squid -d l -D", setelah itu tekan ctrl+c.
  12. Setelah itu mendaftarkan squid ke registry windows dengan jalan ketik "squid i"
  13. Kemudian yang terakhir ketik "squid -O -D
  14. Kamu bisa menjalankan squid dengan cara ketik services.msc di start menu -> run.
Selanjutnya adalah mensetting di browser client. Ingat ip address dari server proxy kamu, masukkan port: 3128 atau sesuai dengan port yang kamu berikan di file tadi.
Setting Squid Proxy di Browser
Selamat mencoba.

Tidak ada komentar:

Posting Komentar