Website Bloking with Proxy Debian Server / Cara Memblog Website

Seperti biasa langsung pada konfigurasi :) , jangan lupa masuk sebagai admin ( root )

~#apt-get insatall squid

~#service squid stop

~#nano /etc/squid/squid.conf

( ctrl + w ) -- http_port 3128

( tambahkan script berikut disamping http_port 3128 )     transparent

( tambahkan script berikut dibawah http_port 3128 )     cache_mem 16 MB
                            cache_mgr akhdiat@smkn1tanjung.sch.id

                            visible_hostname www.smkn1tanjung.sch.id

( tambahkan script berikut dibawah acl connect method ) acl lan src ( ip network private )

                            acl dontopen dstdomain "/etc/squid/dontopen.txt"
                            http_access deny dontopen
                            http_access allow lan
                            http_access allow all

~#nano /etc/squid/dontopen.txt

( masukkan nama website yang ingin anda block contoh www.facebook.com, www.sex.com, www.youtube.com )

( save )
~#iptables -t nat -A PREROUTING -s ( ip network private ) -d 0/0 -p tcp --dport 80 -j REDIRECT --to-ports 3128

~#iptables-save

~# nano /etc/rc.local

( tambahkan script berikut diatas exit 0 ) iptables -t nat -A PREROUTING -s ( ip network private ) -d 0/0 -p tcp --dport 80 -j REDIRECT --to-ports 3128

~#service squid restart

( Cara mentesnya silahkan buka browser anda dan buka website yang anda block tadi apabila muncul tampilan ERROR pada website anda maka Website blocking with proxy telah berjalan dengan baik )
Add caption


Salam TKJ :)

0 Comments: