Guide to filter ads using Squid and free redirector on Windows

Here’s another tutorial again by me to configure Squid Proxy Server on Windows to filter intrusive ads, popups, javascript ads, etc by using an Open Source / Free Redirector program for Squid called AdZapper. And by using this free redirector you can filter out almost (but not all) ads, html webbugs, and many other. And for those who didn’t know on how to setup a Squid Proxy on Windows you can read my guide on how to configure squid for windows. But since this is going to be a long page (if its for me who wrote this guide) you’ll have to read more to continue :)

First you must already have this tools on your system :

  • SquidNT for Windows from AcmeConsulting (if you’re using Squid 2.5 Stable, you’ll need to configure it by yourself. Because my previous guide is for Squid 2.6 Stable, although there’s only a few differences between the 2.5 version and 2.6 version)
  • AdZapper … well you’re going to need this tools since this tutorials topic is about AdZapper

Note: For the Cygwin version the AdZapper version you’re going to download is adzap-20060424.tar.gz or similar file name like that on adzapper homepage. And for those who don’t want to use the cygwin version, you should download the perl script version and don’t forget to rename it to squid_redirect.pl (its not necessary though as long as you configure the ActivePerl correctly)

  • Cygwin setup package, and don’t forget to install Perl and GNU Bourne-Again Shell (SH) from the Cygwin package since you’re going to need this tools. And this is going to be a big downloads if you install all the cygwin packages :D (im downloading this from Internet Cafe or called Warnet in my country since i dont have unlimited internet access)

Note: If you don’t have an unlimited internet access like me or using a Dial Up connection you can use other method by downloading Squid and Perl only, but do not download Perl from Cygwin Package. Download it from ActiveState ActivePerl instead

And now im going to start the tutorials :

Note: The next step is for someone who’s using Cygwin version !! for the ActivePerl version continue to the bottom of this page

I assume you’ve already read my tutorials about Configuring Squid for Windows .. so im going to the next step.

  • Extract the contents of the AdZapper using your favorite archiver programs to any directory of your choice
  • Open wrapzap from the scripts/wrapzap using your favorite editor (but since its on Unix format you’ll need to use Wordpad if you don’t have 3rd party editor, and if you’re using notepad you can’t read the file correctly) and edit these line :

zapper=x:/xxx/adzap/scripts/squid_redirect (where x is the adzapper path on your computer)

ZAP_MODE=CLEAR (if you prefer to see AdZapped image there’s no need to edit these line)

ZAP_BASE=http://xxxxxxxxx (if you run your own webserver, you can edit these line so the replacement images for the zapped ads are going to be from your own server instead of AdZapper homepage)

and the last one is put these line into squid.conf :

redirect_program x:/xxxx/bin/sh.exe y:/yyy/adzap/scripts/wrapzap (where x is the cygwin path on your system and y is the adzap path on your system)

and start the squid services and the cygwin version of this is complete. Now here’s the ActivePerl guide :

  • I assume you’ve already downloaded and install the activeperl on your system so im going to continue to the next step
  • Copy the squid_redirect.pl into your favorite folder (the easiest way is by copying this into your squid directory under adzap directory)
  • and put these lines at squid.conf file :

redirect_program x:/xxx/bin/perl.exe y:/yyy/adzap/scripts/squid_redirect (where x is the activeperl installation path on your system, and y is the adzap path on your system)

And that’s it you’re finished ;) … i hope you’ll like this guide :)

Comment?

Note: Comment may not appear right away.

2 comments on “Guide to filter ads using Squid and free redirector on Windows

  1. AdZapper is a toy not url filtering soft. You’re really so naive to believe that you alone can create filters that will blick unwanted items (thi normally do thousands of people)?