Senin, 30 September 2013

KONFIGURASI PROXY SERVER (SQUID3)

PROXY SERVER (SQUID3)

Langkah Instalasi dan konfigurasi Proxy Server (Squid3)
Install dengan perintah
$ apt-get install squid3
langkah-langkah untuk mengkonfigurasi squid sebagai proxy caching server
1. Edit file /etc/squid3/squid.conf
$ nano /etc/squid3/squid.conf
2. Bagian-bagian yang harus di edit adalah:
http_port
# http_port 3128
menjadi :
http_port 3128
cache_effective_user
# cache_effective_user proxy
menjadi :
cache_effective_user proxy

 cache_effective_group
# cache_effective_group proxy
menjadi :
cache_effective_group proxy

Memori yang dialokasikan untuk menjalankan squid server.
# cache_mem 8 MB
menjadi
cache_mem 16 MB

cache_mgr
#cache_mgr webmaster
Menjadi :
cache_mgr webmaster@jaringan.info
cache dir, arahkan sesuai direktori tempat cache di simpan dan atur space
alokasinya sesuai besar cache yang diperlukan. Mis: direktori cache
/var/spool/squid, dan alokasi nya 5000 Mb.
# cache_dir ufs /var/spool/squid 100 16 256
menjadi
cache_dir ufs /cache 2000 16 256
setelah itu cari baris :
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
lalu tambahkan:
http_access allow lan
menjadi:
http_access allow localhost
http_access allow lan
# And finally deny all other access to this proxy
http_access deny all
Selanjutnya tambahkan baris visible_hostname
visible_hostname proxy.Jaringan.info
3. Buat folder cache dir, sesuai konfigurasi. Mis: /cache
$ sudo mkdir -p /cache
$ sudo chown proxy.proxy /cache
4. Buat cache, dengan perintah:
$ sudo squid3 –z
$ sudo /etc/init.d/squid3 start

Untuk memfilter sesuai domain edit file /etc/squid3/squid.conf, lalu tambah baris
berikut sebelum baris http_access allow localhost.
acl lan src 192.1.2.0/24
acl domain-terlarang url_regex “/etc/squid3/domain-terlarang”
http_access deny domain-terlarang
Simpan hasil konfigurasi, lalu buat file /etc/squid3/domain-terlarang dengan isi
file berisi alamat-alamat situs/domain-domain yang dilarang di akses.
$ nano /etc/squid3/domain-terlarang
Misal contoh isi file:
www.facebook.com
google.com

Untuk memfilter berdasarkan kata atau huruf yang terkandung pada nama
domain caranya hampir sama, edit file /etc/squid3/squid.conf. lalu tambahkan
baris berikut :
acl kata-terlarang url_regex -i “/etc/squid3/kata-terlarang”
http_access deny kata-terlarang
Simpan hasil konfigurasi, lalu buat file /etc/squid3/kata-terlarang dengan isi file
berisi kata-kata yang dilarang di akses.
$ nano /etc/squid3/kata-terlarang
Misal contoh isi file:
porno
sex
xxx

daftar pustaka :  http://nixcraft.com/linux-software/544-how-block-sites-squid.html


http://numb.web.id/linux/cara-setting-acl-squid-proxy-untuk-blokir-website-tidak-baik-di-ubuntu-server.html