[OT] minimalist web server

Dave Benjamin ramen at lackingtalent.com
Sun Dec 2 00:13:23 EST 2007


Daniel Fetchinson wrote:
> The reason I need this is that my current best strategy to avoid ads
> in web pages is putting all ad server names into /etc/hosts and stick
> my local ip number next to them (127.0.0.1) so every ad request goes
> to my machine. I run apache which has an empty page for 404 errors so
> I'll just see that blank page for every ad. Now I guess apache is a
> pretty heavy weight guy so I'm looking for a lightweight alternative.
> Lighttpd, nginx and company are all too complex and "know" too much. I
> even considered just putting netcat into an infinite loop but I'm
> afraid if there is a security hole in netcat I might be screwed.

I don't know if this qualifies as "lightweight", but my current best 
strategy is to block ads using a Squid proxy. My /etc/squid/squid.conf has:

acl ads dstdom_regex -i "/etc/squid/squid.adservers"
http_access deny ads
deny_info javascript:void(0) ads

/etc/squid/squid.adservers came from this site:
http://pgl.yoyo.org/adservers/

Ads completely disappear with no visible errors or unnecessary HTTP 
requests. (Sorry, no Python needed for this one.)

Dave



More information about the Python-list mailing list