Blocking Papan Iklan !

Posted on

Hari ini sedikit maen bentar sembari iseng and ngelepas penat gara-gara kerjaan yang kelewat banyak nich… sebenarnya banner udah bisa ke block dengan cara manual… alias di definisikan sendiri dalam ACL -nya squid.

# =================================== #
# BLOCKING CONTENTS & ADS
# =================================== #
acl bad url_regex “/usr/local/etc/squid/blocker/bad.acl”
http_access deny bad

Nah untuk block banner manual didalam file bad.acl ada content seperti ini :

^http://www\.submit-it.*
^http://ads01.*
^http://www\.eads.*
^http://ads\.
^http://ad\.
^http://ads02\.
^http://adaver.*\.
^http://adforce\.
/images/[Aa][Dd]/
/reklame/
/[Bb]anners/
adbot\.com
adserver

Ya semacam itulah… but yang aku gak nemu cara manual block google Adsanse… karena males mikir… dan kira2 rada kuno juga cara seperti itu, block manual, kepikiran gunain redirect program aza buat squid-nya biar lebih efisien katanya :p

Akhirnya pake juga Adzaper untuk blocking papan iklan 😀 di mesin proxy FreeBSD. Cara installasi dan konfigurasinya mudah gak gak sampe 2 menit !

Install Adzap-nya dari ports FreeBSD (inilah cantiknya FreeBSD) !

proxy# whereis adzap
proxy# cd /usr/ports/www/adzap
proxy# make install clean

Akhir installasi dari ports akan ada informasi cara konfigurasinya :

=====================================================

Adzap has now been installed. To get it up and running, copy
/usr/local/share/examples/adzap/adzap.conf to /usr/local/etc/ and
modify it to match your setup. Then edit your squid configuration
and add /usr/local/libexec/adzap as your http-redirector.

If you run a web server, you can copy files from
/usr/local/share/examples/adzap/zaps to your htdocs tree and
modify the web locations in /usr/local/etc/adzap.conf accordingly.

You can find JavaScript proxy auto-configuration scripts in
/usr/local/share/examples/adzap/rc

=====================================================

Sekarang tinggal diikutin dech ;))

proxy# cp /usr/local/share/examples/adzap/adzap.conf /usr/local/etc/

Edit konfigurasi squid.conf

proxy# ee /usr/local/etc/squid/squid.conf

Tambahkan redirect program-nya !

# =================================== #
# REDIRECT PROGRAM
# =================================== #
redirect_program /usr/local/libexec/adzap

Terkahir silahkan restart squid -nya !

proxy# /usr/local/sbin/squid -k reconfigure

Selesai dech…

Tes coba buka http://detik.com/

Pastikan semua banner / papan iklan ke block semua :))