Saturday, April 2, 2016

Cara Install Squid Limit To IP Pada Centos

1. Lakukan update pada VPS
Karena melakukan update itu wajib menurut saya setiap akan menginstall sesuatu, jadi lakukanlah update terlebih dahulu ya
yum -y update
2. Install Squid pada Centos
Sekarang, barulah kita install squid yang kita tunggu - tunggu dari tadi setelah banyak melewati tantangan membaca :v .
yum -y install squid
3. Squid telah terinstall di VPS, lalu lakukan perintah selanjutnya. Buat backup config asli
cp /etc/squid/squid.conf /etc/squid/squid.conf.backup
4. Hapus file asli (config squidnya)
rm /etc/squid/squid.conf

5. Sekarang ambil config squid dari saya
wget http://rh05here.pe.hu/vps/squid-centos.conf
6. Copykan ke folder squid
cp squid-centos.conf /etc/squid/squid.conf
7. Edit config dengan nano, kalau belum punya nano, install dulu dengan cara

yum -y install nano
8. Edit confignya dengan nano

nano /etc/squid/squid.conf
9. Masukkan script berikut
tulisan yg berwarna merah tebal  ganti tulisan tersebut dengan ip vps Anda, dan jangan merubah susunan sama sekali !!. 


acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
acl SSH dst isi-host-sshmu/255.255.255.255
http_access allow SSH
http_access allow manager localhost
http_access deny manager
http_access allow localhost
http_access deny all
http_port 80
http_port 8080
http_port 3128
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
visible_hostname privateproject02.blogspot.com

10. Jika sudah, tekan Ctrl + O dan enter

11. Selanjutnya memberikan permission pada squid password

touch /etc/squid/passwd
chown root.squid /etc/squid/passwd
chmod 640 /etc/squid/passwd 

12. Membuat direktori cache untuk squid


squid -z

13. Start Squid


squid -D
service squid start
chkconfig squid on

14. Nah squid sudah menyala.

Dan squid ini limit IP, maksudnya selain menyambung ke ssh ip itu sendiri tidak akan bisa, jadi tidak akan merugikan penjual SSH jika menggunakan squid ini. Nah sekian tutor dari saya, jika ada pertanyaan bisa di komen atau di Facebook saya. Sekian dan terimakasih 

No comments:

Post a Comment