~# apt-get
install squid
~# nano
/etc/squid/squid.conf
Cari teks berikut ini :
http_port 3128
tambahkan dan ubah menjadi :
http_port
3128 transparent
cache_mem 64 MB
cache_mgr admin@yanpaul.web.id
visible_hostname www.yanpaul.web.id
Cari teks berikut ini :
acl CONNECT method CONNECT
tambahkan di bawah tersebut:
acl url dstdomain “/etc/squid/url”
acl key url_regex –i “/etc/squid/key”
acl lan src 172.10.18.1/27
http_access deny url
http_access deny key
http_access allow lan
http_access deny all
setelah itu disimpan (CTRL+O <enter>,
CTRL+X)
~#
nano /etc/squid/url
isikan website yang akan diblok:
www.youtube.com
www.facebook.com
setelah itu disimpan (CTRL+O <enter>,
CTRL+X)
~#
nano /etc/squid/key
isikan website yang akan diblok:
porn
sex
sexy
setelah itu disimpan (CTRL+O <enter>,
CTRL+X)
~#
nano /etc/rc.local
ketikkan perintah tersebut di atas ‘exit 0’ :
iptables –t nat –A PREROUTING –s 172.10.18.0/27 –p tcp --dport 80 –j
REDIRECT –-to–port 3128
exit 0
~# service squid
restart
~# reboot
No comments:
Post a Comment