Hadrian.my.id – Sudah mulai bosan menyewa private proxy dari orang lain? ingin rasanya bisa buat private proxy sendiri? tepat sekali elo datang kesini! gak susah sebenarnya membuat private proxy, asalkan elo punya VPS (virtual private server). Tenang, gak usah takut harus mengeluarkan banyak biaya, coba elo lihat artikel sebelumnya

Selengkapnya:  Tips Membeli VPS Murah Tapi Bagus

Terus sistem operasi VPS apa yang biasanya digunakan untuk membuat private proxy? sudah pasti Linux! karena dengan linux elo bisa menginstal Squid. Sebab, squid digunakan untuk proxy server dan juga web cache (baca selengkapnya https://id.wikipedia.org/wiki/Squid )

gue merekomendasi untuk Linux dengan sistem operasi CentOS atau Debian, karena tutorial yang bakal gue jabarkan menggunakan sistem operasi tersebut. Oleh karenanya, gue mau menjawab kegelisahan elo selama ini, semoga dengan cara membuat private proxy, blog gue selalu sepi pengunjung 🙂

Unduh putty dan masuk ke akun ssh VPS

Sesuaikan dengan sistem operasi komputer elo

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Instalasi squid di CentOS

yum update -y
yum install httpd-tools
yum install squid
yum install nano
mv /etc/squid/squid.conf /etc/squid/squid.conf.old
nano /etc/squid/squid.conf

Copy, paste, dan save script dibawah ini
(pastikan ###.##.##.### diganti IP VPS elo)

#Sesuaikan port yang mau elo gunakan
http_port 3128

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 localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
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 CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access allow localnet
http_access allow localhost
hierarchy_stoplist cgi-bin ?
coredump_dir /var/spool/squid
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

#IP VPS elo tanpa autentikasi
acl myclients src ###.##.##.###

#mengizinkan IP diakses tanpa autentikasi
http_access allow myclients 

#jika mesin elo 32 bit, hapus 64 dari /lib64/
auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/squid_access 
auth_param basic childred 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
acl ncsaauth proxy_auth REQUIRED
http_access allow ncsaauth
forwarded_for off

#Ganti dengan IP VPS elo.
acl ip1 myip ###.##.##.###
tcp_outgoing_address ###.##.##.### ip1 

request_header_access Allow allow all 
request_header_access Authorization allow all 
request_header_access WWW-Authenticate allow all 
request_header_access Proxy-Authorization allow all 
request_header_access Proxy-Authenticate allow all 
request_header_access Cache-Control allow all 
request_header_access Content-Encoding allow all 
request_header_access Content-Length allow all 
request_header_access Content-Type allow all 
request_header_access Date allow all 
request_header_access Expires allow all 
request_header_access Host allow all 
request_header_access If-Modified-Since allow all 
request_header_access Last-Modified allow all 
request_header_access Location allow all 
request_header_access Pragma allow all 
request_header_access Accept allow all 
request_header_access Accept-Charset allow all 
request_header_access Accept-Encoding allow all 
request_header_access Accept-Language allow all 
request_header_access Content-Language allow all 
request_header_access Mime-Version allow all 
request_header_access Retry-After allow all 
request_header_access Title allow all 
request_header_access Connection allow all 
request_header_access Proxy-Connection allow all 
request_header_access User-Agent allow all 
request_header_access Cookie allow all 
request_header_access All deny all

#Alokasi 3GB untuk caching
cache_dir ufs /var/spool/squid 3000 16 256 

#Maksimal Cache Object 1GB
maximum_object_size 1024 KB

#Menggunakan 1GB RAM untuk Cache
cache_mem 1024 MB
squid -z
chkconfig squid on
touch /etc/squid/squid_access

Ganti [USER] dibawah dengan user private proxy yang elo inginkan

htpasswd /etc/squid/squid_access [USER]

Setelah buat user, pasti elo disuruh isi password sebanyak 2 kali. Jangan panik ketika elo tulis password gak kelihatan karena disembunyikan demi keamanan. Terakhir jalankan squid

service squid start

Sekarang private proxy siap digunakan!

Perintah tambahan

Untuk berhentikan squid

service squid stop

Melihat log private proxy

tail -f /var/squid/access.log

Untuk instalasi squid di debian lain kali gue akan jabarkan oke! jika elo mengalami masalah bisa langsung berkomentar dibawah.