Rejecting Ads with Apache Proxy

What Is This?

Annoyed with all those banner ads? Sick of wasting your precious 28.8 time on loading enormous inane animated gifs? Jealous of those WebFree users?

Well kvetch no longer: if you run an Apache webserver version 1.2.4, you can nuke unwanted ads by modifying the functioning of the mod_proxy module. In my household, I run mod_proxy to eliminate redundant network loads across our tiny 28.8 line: by modifying mod_proxy I now remove all ads too.


How Is It Done?

I took my cue from WebFree, a macintosh control panel that filters out urls matching a set of substrings. (For single machine use, WebFree is much more elegant than my proxy approch.)

I defined a new directive for httpd.conf ProxyIgnore. ProxyIgnore takes one string argument which denotes an unwanted substring. There may be an unlimited number of ProxyIgnore lines. If any of the ProxyIgnore substrings are found in any requested URL, that URL is aborted (proxy_error). For example:

ProxyIgnore     /adv/
ProxyIgnore     /ad/
ProxyIgnore     /ads/
ProxyIgnore     /Ads/
Apache already had the ability to remove some ads with the ProxyBlock directive. For instance:
ProxyBlock	ad.doubleclick.net

How Do I Try It?

The patches are still VERY ROUGH, essentially only an hour or two of hacking. The directive name ProxyIgnore may need to be changed. A better method of aborting the bitmap load rather than returning a broken image may be possible.

Download patches proxy_0.5.tar.gz.


Comments? | Banshee 1997.