SETUP PROXY PADA VPS DEBIAN 6


SETUP PROXY PADA VPS DEBIAN 6
Seperti biasa silahkan login pada tools seperti putty sebagai root untuk mengakses VPS kita. Jika sudah, silahkan instal squid (untuk build proxy pada VPS) dengan perintah ini:


apt-get install squid


Selanjutnya kita akan menginstall apache2-utils karena disini saya menggunakan modul NCSA untuk sistem authentikasi (login). Silahkan ketik perintahnya seperti ini:
apt-get install apache2-utils

Kemudian coba buat login dan pasword untuk proxy yang akan kita buat dengan perintah berikut:
htpasswd -c /etc/squid/passwd omondos

Pada contoh perintah diatas, saya membuat user "omondos" (silahkan ganti kata omondos dengan user yang kalian inginkan), dan setelah perintah tersebut dijalankan maka kita akan diminta untuk setting pasword yang kita inginkan (biasanya disuruh isi pasword 2x)

Selanjutnya agar squid bisa membaca pasword kita tadi, silahkan ketikan perintah berikut:
chmod o+r /etc/squid/passwd

dilanjutkan dengan memeriksa lokasi ncsa_auth dengan perintah berikut:
dpkg -L squid | grep ncsa_auth

jika sudah Oke, maka yang keluar adalah tulisan seperti ini: /usr/lib/squid/ncsa_auth

Selanjutnya backup terlebih dahulu default config squid dengan menuliskan perintah berikut:
mv /etc/squid/squid.conf /etc/squid/squid.conf.old

Sekarang saatnya membuat file squid config baru dengan mengetikan perintah berikut:
nano /etc/squid/squid.conf

Kemudian masukan konfigurasinya seperti ini:
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl ncsa_users proxy_auth REQUIRED

acl SSL_ports port 443          # https
acl SSL_ports port 563          # snews
acl SSL_ports port 873          # rsync
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
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 purge method PURGE
acl CONNECT method CONNECT

http_access allow manager localhost
http_access arief manager
http_access allow purge localhost
http_access arief purge
http_access arief !Safe_ports
http_access arief CONNECT !SSL_ports
http_access allow localhost
http_access allow ncsa_users
http_access arief all

icp_access arief all
http_port 3128
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid 1000 16 256
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern (Release|Packages(.gz)*)$       0       20%     2880
refresh_pattern .               0       20%     4320
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 arief shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
dns_nameservers 8.8.8.8 8.8.4.4
hosts_file /etc/hosts
coredump_dir /var/spool/squid

Jika sudah silahkan tekan Ctrl O, kemudian enter dan tekan Ctrl X untuk keluar dari config squid. Selanjutnya silahkan restart squid dengan perintah berikut:
/etc/init.d/squid restart

Untuk mengetahui proxy yang kita buat tadi berjalan dengan baik atau tidak, silahkan menggunakan proxy checker seperti http://ping.eu/proxy/
hasil testing proxy checker

atau bisa juga menggunakan perintah berikut pada putty:

netstat -pln | grep squid

jika sukses maka keterangan yang keluar akan seperti ini:
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)
 Kira-kira itu saja untuk membuat proxy pribadi pada VPS kita.

                                                             SELAMAT MENCOBA ^_^

Komentar

Postingan populer dari blog ini

Daftar Pemain Sepak Bola Klub Real Madrid 2013-2014