Langkah Membuat Squid Proxy di Linux/Unix server

A. Download dulu squid nya http://www.squid-cache.org/Versions/…TABLE11.tar.gz
B. Kemuian Ekstrak: tar -zxvf squid-2.5.STABLE11.tar.gz
C. Setelah selesai, masuk ke folder nya .. lalu.. configure
Rumus untuk configure squid yg baik dan benar adalah :
./configure –prefix=/usr/local/squid –exec-prefix=/usr/local/squid –enable-delay-pools –enable-cache-diggests –enable-poll –disable-ident-lookups –enable-async-io=16 –enable-auth-modules –enable-removal-policies –enable-snmp

D. setelah itu buat user squid nya dulu.. n ini harus butuh root login buat adduser nya
Rumus nya :

useradd -d /usr/local/squid/ -r -s /dev/null squid > /dev/null 2>&1

copy paste aja ke box nya.. okie? sip..!

E. lalu pencet/ketik make all then make install
F. nah kemudian masuk ke dir /usr/local/squid/etc dan lihat squid.conf
G. edit deh squid.conf nya seperti begini

ini hanya contoh conf aja .. jangan di copy semua nya:

##contoh
http_port 202.155.166.24:8888 <= dimana 8888 adalah portnya##
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
#Recommended minimum configuration:
#auth_param digest program <uncomment and complete this line>
#auth_param digest children 5
#auth_param digest realm Squid proxy-caching web server
#auth_param digest nonce_garbage_interval 5 minutes
#auth_param digest nonce_max_duration 30 minutes
#auth_param digest nonce_max_count 50
#auth_param ntlm program <uncomment and complete this line to activate>
#auth_param ntlm children 5
#auth_param ntlm max_challenge_reuses 0
#auth_param ntlm max_challenge_lifetime 2 minutes
#auth_param ntlm use_ntlm_negotiate off
#auth_param basic program <uncomment and complete this line>
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
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
#Examples:
#acl macaddress arp 09:00:2b:23:45:67
#acl myexample dst_as 1241
#acl password proxy_auth REQUIRED
#acl fileupload req_mime_type -i ^multipart/form-data$
#acl javascript rep_mime_type -i ^application/x-javascript$
#
#Recommended minimum configuration:
acl all src 0.0.0.0/0.0.0.0
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
###### masukan ip yang bole akses ######
acl myserver src 202.162.192.10/32
##################################
acl SSL_ports port 443 563
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 CONNECT method CONNECT

http_access allow myserver
http_access allow manager localhost
http_access deny manager

# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all
icp_access allow all

header_access From deny all
header_access Referer deny all
header_access Server deny all
header_access User-Agent deny all
header_access WWW-Authenticate deny all <- di deny kalau si squid nya ga mau ada popup² yg mengganggu
header_access Link deny all
header_replace User-Agent Cisco Cache Engine, Version 1.7.0
header_access Accept-Encoding deny all
header_access X-Forwarded-For deny all
header_access Via deny all

Note: acl myserver src 202.162.192.10/32 <<– ganti IP Server

Dan Kemudian Ingat untuk Save!

H. lalu ketik:
chown -R squid.squid /usr/local/squid
chmod 777 /usr/local/squid/var/logs/
chmod 777 /usr/local/squid/var/
I. Klo dah beres ktik, /usr/local/squid/sbin/squid -z
J. klo sukses creating swap nya.. lalu ktik /usr/local/squid/sbin/squid
K. cek ps -aux apakah ada proses squid nya? dan cek netstat -plnat apakah port nya sudah listen?

Kalau ada error pas running squid nya coba cari error nya kenapa ketik: tail -f /var/logs/messeges

Buat config ulang squid pake command :
/usr/local/squid/sbin/squid -k reconfigure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: