-->

Masalah terkadang membuat kita tumbuh. untuk explore tentang solusi

Recents in Beach

Motivasi Menulis

Setting squid Proxy

Nah kalo di postingan sebelum nya udah ngebahas cara instalasi ubuntu server. dari awal sampai habis udah dibahas.. sesuai dengan janji aku.. aku juga bakal ngebahas cara setting squid. sebelumnya mungkin ada yang belum tau tentang squid.. Squid adalah software publik domain berbasis UNIX. fungsi dari squid adalah meng-‘cache’ atau menyimpan data yang diminta oleh pengguna (komputer client) biasanya berupa web pages dan FTP. Platform UNIX yang di support oleh Squid adalah FreeBSD, BSDI, Digital Unix, Irix, Linux, Solaris dan SunOs. Tidak semua data bisa di cache oleh Squid, data-data yang bersifat dinamik seperti CGI-BIN tidak di cache oleh Squid, jadi tiap kali ada permintaan CGI-BIN, maka Squid akan menghubungi langsung server tujuan. Saat ini protokol yang bisa dilayani oleh Squid adalah HTTP, FTP, Gopher, dan Wais. itulah definisi squid secara teori nya...
OKe kita lanjut Configurasi squidnya yok... takut gak keburu ntar.... ini dia konfigurasinya




Configure The Network
vi /etc/network/interfaces

dengan konfigurasi sebagai berikut :

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface

auto lo

iface lo inet loopback


# The primary network interface
auto eth0
iface eth0 inet static
        address 0.0.0.0
        netmask 0.0.0.0
        network 0.0.0.0
        broadcast 0.0.0.0
        gateway 0.0.0.0


  • Restart konfigurasi network
    • /etc/init.d/networking restart
    • Edit /etc/hosts
    • vi /etc/host
  • Dengan konfigurasi sebagai berikut :
    • 127.0.0.1           localhost.localdomain   localhost
    • 0.0.0.0               server1.example.com     server1
  •  The following lines are desirable for IPv6 capable hosts
    • ::1     localhost ip6-localhost ip6-loopback
      • fe00::0 ip6-localnet
      • ff00::0 ip6-mcastprefix
      • ff02::1 ip6-allnodes
      • ff02::2 ip6-allrouters
      • ff02::3 ip6-allhosts
  • Jalankan dengan perintah :
    • hostname
    • hostname –f


  • Install dan Konfigurasi Squid Proxy
    • sudo aptitude install squid squid-common
    • Edit the squid config file.
    • sudo vi /etc/squid/squid.conf
    • Set the allowed hosts.
    • acl internal_network src 192.168.0.0/24 ( 192.168.0.0/24 adalah rentang IP anda.)
    • http_access allow internal_network


  • Set the correct permissions.
    • sudo chown -R proxy:proxy /var/log/squid/
    • sudo chown proxy:proxy /etc/squid/squid.conf
  • Restart squid untuk perubahan yang mempengaruhi.
    • sudo /etc/init.d/squid restart
Sekarang buka browser Anda dan mengatur proxy Anda untuk menunjuk ke server squid baru Anda pada port 3128

  • Jika ingin menggunakan otentikasi dengan proxy maka perlu menginstal utilitas apache2
    • sudo aptitude install squid squid-common apache2-utils
  • Edit file konfigurasi squid ( Squid.conf )
    • sudo vi /etc/squid/squid.conf
  • Mengatur parameter otentikasi dan acl
    • auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid.passwd
    • auth_param basic children 5
    • auth_param basic realm NFYE Squid proxy-caching web_server
    • auth_param basic credentialsttl 3 hours
    • auth_param basic casesensitive off
    • acl users proxy_auth REQUIRED
    • acl sectionx proxy_auth REQUIRED
    • http_access allow users
  • Konfigurasi Squid.conf
    • acl all src 0.0.0.0/0.0.0.0
    • acl internal_network src 0.0.0.0/0
    • acl users proxy_auth REQUIRED
    • 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 # https, snews
    • acl SSL_ports port 873 # rsync
    • 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 Safe_ports port 631 # cups
    • acl Safe_ports port 873 # rsync
    • acl Safe_ports port 901 # SWAT
    • acl sectionx proxy_auth REQUIRED
    • acl purge method PURGE
    • acl CONNECT method CONNECT
    • acl all src 0.0.0.0/0.0.0.0
    • acl internal_network src 192.168.0.0/24
    • acl users proxy_auth REQUIRED
    • 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 # https, snews
    • acl SSL_ports port 873 # rsync
    • 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 Safe_ports port 631 # cups
    • acl Safe_ports port 873 # rsync
    • acl Safe_ports port 901 # SWAT
    • acl sectionx proxy_auth REQUIRED
    • acl purge method PURGE
    • acl CONNECT method CONNECT src 192.168.0.0/24
    • acl users proxy_auth REQUIRED
    • 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 # https, snews
    • acl SSL_ports port 873 # rsync
    • 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 Safe_ports port 631 # cups
    • acl Safe_ports port 873 # rsync
    • acl Safe_ports port 901 # SWAT
    • acl sectionx proxy_auth REQUIRED
    • acl purge method PURGE
    • acl CONNECT method CONNECT
    • http_access allow manager localhost localhost
    • http_access allow users
    • http_access allow internal_network
    • http_access deny manager
    • http_access allow purge localhost
    • http_access deny purge
    • http_access deny !Safe_ports
    • http_access deny CONNECT !SSL_ports
    • http_access allow localhost
    • http_access deny all
    • http_reply_access allow all
    • icp_access allow all
Jika Kalian ingin mengarahkan semua lalu lintas HTTP melalui proxy tanpa perlu mengatur proxy secara manual dalam semua aplikasi anda anda perlu menambahkan beberapa aturan

iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.0.1:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
Selesai deh... keriting juga neh jari ngetik terus dari tadi... aku istirahat dulu yah....
Labels: JARINGAN KOMPUTER

Thanks for reading Setting squid Proxy. Please share...!

1 Comments on Setting squid Proxy

Back To Top