Pages

Agustus 03, 2012

Membangun Proxy Server di Ubuntu (Bagian 1)

Proxy Server

Proxy server sudah sangat popular dikalangan pengguna internet, karena kemampuannya untuk menghemat bandwith, meningkatkan keamanan, dan menambah kecepatan web-surfing. Proxy Server adalah server yang bertugas menyimpan sementara (cache) file html server lain, sehingga mempercepat akses internet untuk alamat-alamat yang sudah pernah diakses sebelumnya.

SQUID

Squid adalah software proxy server yang bersifat open source yang sangat terkenal. Cara kerja squid dapat dianalogikan seperti browser (IE/Opera/Netscape) yang menyimpan data suatu site di hardisk sehingga untuk menampilkan site yang sama tinggal mengambil data di cachenya.

Memulai Installasi
Untuk menginstall squid di server kita, gunakan perintah:
$ sudo apt-get install squid

Konfigurasi SQUID sebagai Proxy Caching Server
Untuk mengkonfigurasi squid sebagai proxy caching server, ikuti langkah-langkah berikut:
1. Edit file /etc/squid/squid.conf
    $ sudo vi /etc/squid/squid.conf
2. Bagian-bagian yang harus di edit adalah:
       http_port
          # http_port 3128
      menjadi :
          http_port 3128
       cache_effective_user
          # cache_effective_user proxy
      menjadi :
          cache_effective_user proxy
       cache_effective_group
          # cache_effective_group proxy
      menjadi :
          cache_effective_group proxy
       Memori yang dialokasikan untuk menjalankan squid server.
          # cache_mem 8 MB
      menjadi
          cache_mem 16 MB
       cache_mgr
          #cache_mgr webmaster
      menjadi :
          cache_mgr webmaster@rt.rw
       cache dir, arahkan sesuai direktori tempat cache di simpan dan atur
      space alokasinya sesuai besar cache yang diperlukan. Mis: direktori
      cache /var/spool/squid, dan alokasi nya 5000 Mb.
          # cache_dir ufs /var/spool/squid 100 16 256
      menjadi
          cache_dir ufs /cache 2000 16 256
       Sekarang tambahkan network yang diperbolehkan untuk access proxy server,
      cari bagian :
          #Recommended minimum configuration:
          acl all src 0.0.0.0/0.0.0.0
          acl manager proto cache_object
          acl localhost src 127.0.0.1/255.255.255.255
          acl to_localhost dst 127.0.0.0/8
          acl SSL_ports port 443 563
          acl Safe_ports port 80 # http
          acl Safe_ports port 21 # ftp
          acl Safe_ports port 443 563 # https, snews
          acl Safe_ports port 70 # gopher
          acl Safe_ports port 210 # wais
          acl Safe_ports port 1025-65535 # unregistered ports
          acl Safe_ports port 280 # http-mgmt
          acl Safe_ports port 488 # gss-http
          acl Safe_ports port 591 # filemaker
          acl Safe_ports port 777 # multiling http
          acl CONNECT method CONNECT

      dibawah acl localhost src 127.0.0.1/255.255.255.255, tambahkan network
      yang akan di allowed
          acl lan src 192.168.0.0/255.255.255.0
      setelah itu cari baris :
          http_access allow localhost
          # And finally deny all other access to this proxy
          http_access deny all
      lalu tambahkan:
          http_access allow lan
      menjadi:
          http_access allow localhost
          http_access allow lan
          # And finally deny all other access to this proxy
          http_access deny all
      Selanjutnya tambahkan baris visible_hostname
          visible_hostname proxy.rt.rw
3. Buat folder cache dir, sesuai konfigurasi. Mis: /cache
    $ sudo mkdir -p /cache
    $ sudo chown proxy.proxy /cache
4. Buat cache, dengan perintah:
    $ sudo squid –z
    2007/08/03 01:43:39| Creating Swap Directories
5. Jalankan squid dengan perintah:
    $ sudo /etc/init.d/squid start

0 5komentar:

Posting Komentar