Minggu, 13 Mei 2012

Instalasi Squid, BannerFilter, dan Blocking Website

Sebelumnya akan saya jelaskan terlebih dahulu, instalansi squid di sini sangat mudah, karena hanya melalui simple ports dari FreeBSD. Untuk settingan lainnya bisa diatur melalui instalansi squid proxy yang lain yg ada di situs ini.
Ok, saatnya kita mulai.
lemon# cd /usr/ports/www/squid
lemon# make && make install clean
Saat pengetikan make && make install clean, akan keluar sebuah layar tampilan berwarna biru, yang mencoba memberitahukan Anda, module apa saja yang akan diinstall di dalam squid tersebut, menurut asumsi saya, tinggal kalian check aja semuanya :), so penambahan apa2 yang akan ada di squid.conf tidak memerlukan anda untuk install ualng / configure ulang squid anda.
Setelah tahap instalansi squid selesai, tinggal install bannerfilter. bannerfilter ini sebenernya berguna untuk memblok banner/iklan/advertise yang suka terdapat di situs-situs. Agar kita dapat mengirit bandwitdh yang digunakan.
lemon# cd /usr/ports/www/bannerfilter
lemon# make && make install clean
Setelah selesai penginstalan, bisa di baca bannerfilter.conf nya terdapat pada directory /usr/local/etc/bannerfilter/bannerfilter.com
lemon# pico /usr/local/etc/bannerfilter/bannerfilter.conf
###ISI DARI CONFIG B ANNER FILTER #####
# bannerfilter.conf
#
# Configuration file for BannerFilter 1.3
# http://phroggy.com/bannerfilter/
# Path to the directory containing the data files (if not specified,
# look in the same directory that redirector.pl is in):
DATA = /usr/local/etc/bannerfilter/
# URL of the directory containing the HTML and graphics files (this must
# be accessible to the machine running Squid; it does not need to be
# accessible to the client machines):
WWW = http://127.0.0.1/bannerfilter/  ## <- tempat dimana menaro file bannerfilter, apabila di server anda sudah terinstall apache20, yang anda install dari ports, file/directory bannerfilter akan terdapat pada /usr/local/www/bannerfiler/
jadi tinggal kalian sesuaikan dimana akan anda taro file bannerfilter tersebut.
# Path to the banner log file if you want one (if specified, Squid must have
# write access to this file):
LOG = /var/log/bannerlog.txt
# If you prefer not to see "Blocked", use null.gif instead of banner.gif:
BANNERGIF = blocked.gif
#BANNERGIF = null.gif
#####END ISI BANNERFILTER #####
Sekarang saatnya membuat squid.conf agar dapat jalan bersama bannerfilter serta memblock situs2 tertentu.
lemon# cd /usr/local/etc/squid/
lemon# mv squid.conf asli.squid.conf
lemon# pico squid.conf
######ISI squid.conf#######
icp_port 3130
http_port 8080
http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin?
no_cache deny QUERY
dns_nameservers xxx.xxx.xxx # isi dengan dns isp anda
dns_nameservers xxx.xxx.xxx # isi dengan dns isp anda
cache_mem 64 MB
cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF
cache_swap_low 90
cache_swap_high 95
maximum_object_size 131072 KB
maximum_object_size_in_memory 64 KB
tcp_recv_bufsize 65535 bytes
ipcache_size 8192
fqdncache_size 8192
cache_swap_low 90
cache_swap_high 95
cache_dir diskd /usr/home/cache/01 350 16 256
cache_dir diskd /usr/home/cache/02 350 16 256
cache_access_log /usr/home/cache/logs/access.log
cache_log /usr/home/cache/logs/cache.log
cache_store_log /usr/home/cache/logs/store.log
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
redirect_program /usr/local/libexec/bannerfilter/redirector.pl
acl blockedsites url_regex -i "/usr/local/etc/squid/porn.txt"
acl bannedsites url_regex -i "/usr/local/etc/squid/porn.txt"
http_access deny blockedsites
http_access deny bannedsites
acl all src 0.0.0.0/0.0.0.0
acl lemon src 192.168.10.0/255.255.255.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
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
visible_hostname proxy.lemontreenet.net
cache_mgr tubagus@indofreebsd.or.id
http_access allow lemon
http_access allow manager localhost
#http_access deny blocked_sites
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all
icp_access allow all
coredump_dir /usr/local/squid/cache
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl SSL_ports port 443 563
acl Safe_ports port 80 21 280 448 591 777 443 563 808 70 210 4190-65535
acl CONNECT method CONNECT
acl purgemethod method purge
acl manager proto cache_object
acl avi urlpath_regex -i .avi$
acl mpeg urlpath_regex -i .m1v$ .mpeg$ .mpg$
acl mpeg_2 urlpath_regex -i .m2v$ .vob$
acl mpeg_audio urlpath_regex -i .mpa$ .mp2$ .mp3$ .aac$
acl dat urlpath_regex -i .dat$ .bin$
acl real urlpath_regex -i .ram$ .ra$ .rm$ .rnx$
acl asf urlpath_regex -i .asf$ .wma$ .asx$ .wmv$
acl vivo urlpath_regex -i .viv$ .vivo$
acl blocked_sites url_regex ^http://*.windowsupdate.*/*
acl blocked_sites url_regex ^http://*.microsoft.*/*
acl blocked_sites url_regex ^http://*.sex*.*/*
acl blocked_sites url_regex ^http://*.doubleclick.*/*
no_cache deny real
no_cache deny asf
no_cache deny vivo
httpd_accel_single_host off
acl magic_words1 url_regex -i 192.168.
acl magic_words2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .iso .raw .wav
delay_pools 2
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow magic_words1
delay_class 2 2
delay_parameters 2 5000/150000 5000/120000
delay_access 2 allow magic_words2
delay_initial_bucket_level 50
acl yahoo dstdomain login.yahoo.com
acl yahoo dstdomain mail.yahoo.com
acl hotmail dstdomain hotmail.com
acl friendster dstdomain friendster.com
always_direct allow yahoo
always_direct allow hotmail
always_direct allow friendster
ie_refresh on
###### END squid.conf ######
setelah membuat squid.conf skarang saatnya kita membuat swap squid nya
lemon# mkdir /usr/home/cache/01
lemon# mkdir /usr/home/cache/02
lemon# mkdir /usr/home/cache/logs
lemon# chown -R squid:squid /usr/home/cache/
lemon# pico /usr/local/etc/squid/porn.txt
##### isi dari porn.txt #####
redtube
lalatx
17tahun
sex
##### end dari porn.txt #####
atau anda bisa download langsung file porn, nya di http://agit.co.cc/porn.txt
sudah hampir ratusan lebih situs porn yg saya add disitu. :)
file porn.txt dapet anda tambahkan semau kalian, situs apa saja yang ingin di block
lemon# squid -Z
lemon# pico /etc/rc.conf
tambahkan
squid_enable="YES"
lemon# squid -DFY
skarang kita lihat apakah squid tersebut sudah jalan
lemon# ps -aux | grep squid
root     523  0.0  0.4  5312  2148  ??  Is   Sun12AM   0:00.00 /usr/local/sbin/squid -DFY
squid    526  0.0 32.1 164536 162580  ??  S    Sun12AM   9:11.41 (squid) -DFY (squid)
squid    535  0.0  0.1  1248   592  ??  Is   Sun12AM   0:00.01 (unlinkd) (unlinkd)
squid    589  0.0  0.2  1936  1064  ??  Ss   Sun12AM   0:12.77 diskd 538624 538625 538626
squid    590  0.0  0.2  1936   960  ??  Ss   Sun12AM   0:13.01 diskd 538628 538629 538630
squid  41750  0.0  0.2  1708  1000  ??  Ss    1:26PM   0:00.10 (dnsserver) -s 202.182.48.19 -s 117.103.57.194 -s 117.103.57.195 (dnsserver)
squid  41751  0.0  0.2  1708  1000  ??  Ss    1:26PM   0:00.03 (dnsserver) -s 202.182.48.19 -s 117.103.57.194 -s 117.103.57.195 (dnsserver)
squid  41752  0.0  0.2  1708  1000  ??  Is    1:26PM   0:00.02 (dnsserver) -s 202.182.48.19 -s 117.103.57.194 -s 117.103.57.195 (dnsserver)
squid  41753  0.0  0.2  1708  1000  ??  Is    1:26PM   0:00.02 (dnsserver) -s 202.182.48.19 -s 117.103.57.194 -s 117.103.57.195 (dnsserver)
squid  41754  0.0  0.2  1600   896  ??  Is    1:26PM   0:00.02 (dnsserver) -s 202.182.48.19 -s 117.103.57.194 -s 117.103.57.195 (dnsserver)
squid  41755  0.0  0.5  3244  2472  ??  Ss    1:26PM   0:05.12 /usr/local/bin/perl /usr/local/libexec/bannerfilter/redirector.pl
squid  41756  0.0  0.5  3232  2460  ??  Ss    1:26PM   0:00.38 /usr/local/bin/perl /usr/local/libexec/bannerfilter/redirector.pl
squid  41757  0.0  0.5  3232  2460  ??  Is    1:26PM   0:00.10 /usr/local/bin/perl /usr/local/libexec/bannerfilter/redirector.pl
squid  41758  0.0  0.5  3232  2460  ??  Is    1:26PM   0:00.05 /usr/local/bin/perl /usr/local/libexec/bannerfilter/redirector.pl
squid  41759  0.0  0.5  3232  2460  ??  Is    1:26PM   0:00.05 /usr/local/bin/perl /usr/local/libexec/bannerfilter/redirector.pl
squid  41760  0.0  0.2  1596   944  ??  Ss    1:26PM   0:00.05 (pinger) (pinger)
root   41974  0.0  0.0   372   208  p4  R+    2:50PM   0:00.00 grep squid
lemon#
ok klo di lihat seperti itu berarti squid sudah jalan.
selesai sudah tahap instalansi squid + bannerfilter + blocking website
thanks to indofreebsd at dal.net yang banyak membantu kawan semuanya, mas ogeb, mas dani, yoga dan semuanya yang tidak bisa saya sebutkan satu persatu. dan tidak lupa terima kasih kepada kawan2 yang sama2 membantu dalam pembuahan situs ini.

Tidak ada komentar:

Posting Komentar

Komentarnya mana

readbud - get paid to read and rate articles