Squid adalah aplikasi populer yang
digunakan sebagai server cache proxy web yang menyediakan layanan proxy dan cache
untuk HTTP, HTTPS, FTP, gopher dan protokol jaringan populer. Squid dapat
mengimplementasikan caching Domain Name Server (DNS) lookup dan cache dan proxy
Secure Socket Layer (SSL), dan melakukan caching secara transparan, Squid juga
mendukung berbagai macam protokol caching, seperti Internet Cache Protocol
(ICP), Hypertext Cache Protocol (HTCP), Cache Array Routing Protocol (CARP),
dan Web Cache Coordination Protocol (WCCP).
Proxy Squid cache server adalah solusi yang sangat baik untuk berbagai kebutuhan caching proxy dan server, dan skala dari kantor cabang ke jaringan tingkat perusahaan. Ketika memilih sebuah sistem komputer untuk digunakan khusus sebagai proxy squid, atau caching server, pastikanlah sistem Anda dikonfigurasi dengan sejumlah besar memori fisik untuk meningkatkan kinerjanya.
Tutorial berikut akan mendemonstrasikan cara install dan konfigurasi server proxy dengan SQUID3 pada ubuntu server 12.04
Langkah 1: Install Squid 3
Login ke server ubuntu, dan ketik perintah berikut untuk meng-install squid3 pada ubuntu server 12.04:
Proxy Squid cache server adalah solusi yang sangat baik untuk berbagai kebutuhan caching proxy dan server, dan skala dari kantor cabang ke jaringan tingkat perusahaan. Ketika memilih sebuah sistem komputer untuk digunakan khusus sebagai proxy squid, atau caching server, pastikanlah sistem Anda dikonfigurasi dengan sejumlah besar memori fisik untuk meningkatkan kinerjanya.
Tutorial berikut akan mendemonstrasikan cara install dan konfigurasi server proxy dengan SQUID3 pada ubuntu server 12.04
Langkah 1: Install Squid 3
Login ke server ubuntu, dan ketik perintah berikut untuk meng-install squid3 pada ubuntu server 12.04:
sudo
apt-get squid3
kemudian masukkan password anda, dan
tunggu hingga proses install selesai.
Langkah 2: Konfigurasi Squid 3
Buat folder untuk menyimpan cache misalnya pada /home/cache, kemudian set permission menjadi 777 dengan owner proxy:proxy
Langkah 2: Konfigurasi Squid 3
Buat folder untuk menyimpan cache misalnya pada /home/cache, kemudian set permission menjadi 777 dengan owner proxy:proxy
sudo
mkdir -p /home/cache/
sudo
chmod 777 /home/cache/
sudo
chown proxy:proxy /home/cache/
Sebelum mengubah konfigurasi squid, buatlah backupnya lebih dahulu file /etc/squid3/squid.conf untuk referensi dikemudian hari.
sudo
cp /etc/squid3/squid.conf /etc/squid3/squid.conf.origin
sudo
chmod a-w /etc/squid3/squid.conf.origin
Sekarang edit file
/etc/squid3/squid.conf, hapus dan ganti semua option dengan konfigurasi squid3
dengan perintah berikut :
sudo
nano /etc/squid3/squid.conf
Konfigurasi squid3:
#
ACCESS CONTROLS OPTIONS
#
====================
#
#acl
QUERY berikut saya buat comment karena error saat penulis coba
#acl
QUERY urlpath_regex -i cgi-bin ? .php$ .asp$ .shtml$ .cfm$ .cfml$ .phtml$
.php3$ localhost
acl
all src
acl
localnet src 10.0.0.0/8
#
Your network here
acl
localnet src 192.168.1.0/24
#
acl
localhost src 127.0.0.1/32
acl
safeports port 21 70 80 210 280 443 488 563 591 631 777 901 81 3128 1025-65535
acl
sslports port 443 563 81 2087 10000
acl
manager proto cache_object
acl
purge method PURGE
acl
connect method CONNECT
acl
ym dstdomain .messenger.yahoo.com .psq.yahoo.com
acl
ym dstdomain .us.il.yimg.com .msg.yahoo.com .pager.yahoo.com
acl
ym dstdomain .rareedge.com .ytunnelpro.com .chat.yahoo.com
acl
ym dstdomain .voice.yahoo.com
acl
ymregex url_regex yupdater.yim ymsgr myspaceim
#
http_access
deny ym
http_access
deny ymregex
http_access
allow manager localhost
http_access
deny manager
http_access
allow purge localhost
http_access
deny purge
http_access
deny !safeports
http_access
deny CONNECT !sslports
http_access
allow localhost
http_access
allow localnet
http_access
deny all
#
#
NETWORK OPTIONS
#
—————
#
http_port
3128 transparent
#
#
OPTIONS WHICH AFFECT THE CACHE SIZE
#
==============================
#
cache_mem
16 MB
maximum_object_size_in_memory
32 KB
memory_replacement_policy
heap GDSF
cache_replacement_policy
heap LFUDA
cache_dir
aufs /home/cache 10000 14 256
maximum_object_size
128000 KB
cache_swap_low
95
cache_swap_high
99
#
#
LOGFILE PATHNAMES AND CACHE DIRECTORIES
#
==================================
#
access_log
/var/log/squid3/access.log
cache_log
/var/lod/squid3/cache.log
#cache_log
/dev/null
cache_store_log
none
logfile_rotate
5
log_icp_queries
off
#
#
OPTIONS FOR TUNING THE CACHE
#
========================
#
#cache
deny QUERY
#cache
deny QUERY di-comment karena error saat penulis coba
refresh_pattern
^ftp: 1440 20% 10080 reload-into-ims
refresh_pattern
^gopher: 1440 0% 1440
refresh_pattern
-i .(gif|png|jp?g|ico|bmp|tiff?)$ 10080 95% 43200 override-expire
override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern
-i
.(rpm|cab|deb|exe|msi|msu|zip|tar|xz|bz|bz2|lzma|gz|tgz|rar|bin|7z|doc?|xls?|ppt?|pdf|nth|psd|sis)$
10080 90% 43200 override-expire override-lastmod reload-into-ims
ignore-no-cache ignore-private
refresh_pattern
-i .(avi|iso|wav|mid|mp?|mpeg|mov|3gp|wm?|swf|flv|x-flv|axd)$ 43200 95% 432000
override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern
-i .(html|htm|css|js)$ 1440 75% 40320
refresh_pattern
-i .index.(html|htm)$ 0 75% 10080
refresh_pattern
-i (/cgi-bin/|?) 0 0% 0
refresh_pattern
. 1440 90% 10080
#
quick_abort_min
0 KB
quick_abort_max
0 KB
quick_abort_pct
100
store_avg_object_size
13 KB
#
#
HTTP OPTIONS
#
===========
vary_ignore_expire
on
#
#
ANONIMITY OPTIONS
#
===============
#
request_header_access
From deny all
request_header_access
Server deny all
request_header_access
Link deny all
request_header_access
Via deny all
request_header_access
X-Forwarded-For deny all
#
#
TIMEOUTS
#
=======
#
forward_timeout
240 second
connect_timeout
30 second
peer_connect_timeout
5 second
read_timeout
600 second
request_timeout
60 second
shutdown_lifetime
10 second
#
#
ADMINISTRATIVE PARAMETERS
#
=====================
#
cache_mgr
webmaster
cache_effective_user
proxy
cache_effective_group
proxy
httpd_suppress_version_string
on
visible_hostname
proxy
#
ftp_list_width
32
ftp_passive
on
ftp_sanitycheck
on
#
#
DNS OPTIONS
#
==========
#
dns_timeout
10 seconds
dns_nameservers
192.168.1.1 #DNS lokal jika ada
dns_nameservers
8.8.8.8 203.130.208.18 # DNS Server
#
#
MISCELLANEOUS
#
===========
#
memory_pools
off
client_db
off
reload_into_ims
on
#coredump_dir
/cache
coredump_dir
/home/cache
pipeline_prefetch
on
offline_mode
off
#
#Marking
ZPH
#==========
#zph_mode
tos
#zph_local
0x30
#zph_parent
0
#zph_option
136
qos_flows
tos
qos_flows
local-hit = 0x30
qos_flows
parent-hit = 0
###
END CONFIGURATION ###
Langkah 3: Jalankan Squid3
Pertama, buat direktori swap,
Pertama, buat direktori swap,
sudo
squid3 -z
Restart squid3:
sudo
/etc/init.d/squid3 restart
atau
sudo
service squid3 restart
Masukkan squid3 sebagai service yang
otomatis running saat booting
sudo
chkconfig --level 345 squid3 on
Referensi:
http://ubuntuserverguide.com/2012/05/how-to-install-and-configure-proxy-server-with-squid3-on-ubuntu-server-12-04-lts.html
Post a Comment