Cara mudah install squid proxy server 5 menit sukses

INSTALASI

Sebelum memulai instalasi, saya asumsikan anda sudah memiliki VPS dengan OS Debian (fresh installation, 32 bit/64 bit).
  1. Langkah pertama, kita akan update dulu package list & kemudian melakukan upgrade package. Ketikkan perintah:
    apt-get update && apt-get upgrade
  2. Kemudian kita akan install Squid, dengan perintah:
    apt-get install squid
  3. Karena kita akan menggunakan modul NCSA untuk sistem authentikasi (login), maka kita harus install apache2-utils agar kita bisa menggunakan perintah htpasswd untuk membuat username & password. ketikkan perintah:
    apt-get install apache2-utils
  4. Selanjutnya kita akan membuat username & password agar kita bisa menggunakan proxy server ini, masukkan perintah:
     htpasswd -c /etc/squid/passwd test123
    NOTE: ganti test123 dengan username yang anda inginkan.
    Kemudian akan diminta memasukkan password yang dikehendaki.
  5. Agar squid bisa membaca file passwd yang barusan anda buat, ketikkan perintah:
    chmod o+r /etc/squid/passwd
  6. Selanjutnya kita akan memeriksa lokasi ncsa_auth dengan perintah:
    dpkg -L squid | grep ncsa_auth
    Output perintah diatas akan muncul lokasi ncsa_auth yang biasanya adalah /usr/lib/squid/ncsa_auth
  7. Berikutnya kita akan melakukan konfigurasi file squid.conf sesuai dengan kebutuhan kita. Backup dulu default squid.conf dengan perintah:
    mv /etc/squid/squid.conf /etc/squid/squid.conf.old
  8. Kita buat file squid.conf baru dengan perintah:
    nano /etc/squid/squid.conf
    dan masukkan konfigurasi berikut:
    DATA HOSTED WITH ♥ BY PASTEBIN.COM - DOWNLOAD RAW - SEE ORIGINAL
    1. auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
    2. auth_param basic children 5
    3. auth_param basic realm Squid proxy-caching web server
    4. auth_param basic credentialsttl 2 hours
    5. auth_param basic casesensitive off
    6.  
    7. acl all src all
    8. acl manager proto cache_object
    9. acl localhost src 127.0.0.1/32
    10. acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
    11. acl ncsa_users proxy_auth REQUIRED
    12.  
    13. acl SSL_ports port 443          # https
    14. acl SSL_ports port 563          # snews
    15. acl SSL_ports port 873          # rsync
    16. acl Safe_ports port 80          # http
    17. acl Safe_ports port 21          # ftp
    18. acl Safe_ports port 443         # https
    19. acl Safe_ports port 70          # gopher
    20. acl Safe_ports port 210         # wais
    21. acl Safe_ports port 1025-65535  # unregistered ports
    22. acl Safe_ports port 280         # http-mgmt
    23. acl Safe_ports port 488         # gss-http
    24. acl Safe_ports port 591         # filemaker
    25. acl Safe_ports port 777         # multiling http
    26. acl Safe_ports port 631         # cups
    27. acl Safe_ports port 873         # rsync
    28. acl Safe_ports port 901         # SWAT
    29. acl purge method PURGE
    30. acl CONNECT method CONNECT
    31.  
    32. http_access allow manager localhost
    33. http_access deny manager
    34. http_access allow purge localhost
    35. http_access deny purge
    36. http_access deny !Safe_ports
    37. http_access deny CONNECT !SSL_ports
    38. http_access allow localhost
    39. http_access allow ncsa_users
    40. http_access deny all
    41.  
    42. icp_access deny all
    43. http_port 3128
    44. hierarchy_stoplist cgi-bin ?
    45. cache_dir ufs /var/spool/squid 1000 16 256
    46. access_log /var/log/squid/access.log squid
    47. refresh_pattern ^ftp:           1440    20%     10080
    48. refresh_pattern ^gopher:        1440    0%      1440
    49. refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
    50. refresh_pattern (Release|Packages(.gz)*)$       0       20%     2880
    51. refresh_pattern .               0       20%     4320
    52. acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
    53. upgrade_http0.9 deny shoutcast
    54. acl apache rep_header Server ^Apache
    55. broken_vary_encoding allow apache
    56. extension_methods REPORT MERGE MKACTIVITY CHECKOUT
    57. dns_nameservers 8.8.8.8 8.8.4.4
    58. hosts_file /etc/hosts
    59. coredump_dir /var/spool/squid
  9. Restart squid dengan perintah:
    /etc/init.d/squid restart
  10. Done! Private proxy server anda sudah siap digunakan.
  11. Untuk memeriksa apakah Squid sudah berjalan di server kita, ketikkan perintah:
    netstat -pln | grep squid
    Dan jika keluar output seperti dibawah ini, berarti Squid sudah berjalan dengan baik.
    tcp        0      0 0.0.0.0:3128            0.0.0.0:*               LISTEN      2594/(squid)
    udp 0 0 0.0.0.0:3130 0.0.0.0:* 2594/(squid)
    udp 0 0 0.0.0.0:44716 0.0.0.0:* 2594/(squid)

0 Response to "Cara mudah install squid proxy server 5 menit sukses"

Post a Comment