Johannes' squid page

Johannes Franken

On this page I show you, how to extend your squid proxy server to remove the advertisement banners from most web pages.

To configure your proxy, follow these five steps:
  1. Append these two lines to your /etc/squid.conf:
    redirect_program /usr/local/bin/
    redirect_children 5

  2. Save the short perl-script [792B] with permissions root:root 755 to /usr/local/bin/. It will exchange advertisement URLs with unoffending ones.
  3. Save the text-file download:squid-blacklist.txt [1 kB] with permissions :users 664 to /etc/. It contains some regexps to recognize advertisement URLs, so you might want to adjust it to your needs.
  4. Put some files on your local webserver, which you want to display in place of the advertisements. Here is my download: collection of transparent pixels in several graphic formats [746B] . Of course, you can alternatively use your own pictures here - maybe you prefer to see some smileys instead of the ads.
  5. restart squid (/etc/init.d/squid restart)

$Id: squid.wml,v 1.10 2006/01/07 18:49:47 jfranken Exp $ [ChangeLog]
$Id:,v 1.82 2010-09-04 12:58:17 jfranken Exp $ [ChangeLog]
© Johannes Franken. Imprint and disclaimer
Valid XHTML 1.0!