Updated referrer spam blocking code


In the previous article I discussed using mod_bw to bandwidth limit the delivery of the cease and desist notices. I've since discontinued this as it was causing an increase on my server loads. I like the idea of doing this, slowing down the requests, but I just didn't want to continue to give this the server resources. And less affective due to some of these referrer spammers use of botnet networks.

The quick and dirty of how this works, enable three common modules in Apache using the following commands:

a2enmod rewrite
a2enmod proxy
a2enmod proxy_http

Adjust your Apache vhost config file to load a hosts black list file, and RewriteCond's to catch common referrer spam from common referrers. Anything matching these rewrite conditions will be rewritten to use the proxy to localhost:8888 which displays (and logs) my Cease and Desist notice.

Updated rewrite rules in Vhost Config to block common referrer spam:

The contents of hosts.deny:

While it is likely that my Cease and Desist notice isn't legally binding, if I can discourage some of these script operators to stop crawling me and behave properly then it's worth it. All the normal legal disclaimer things here; I am not a lawyer, this is not legal advice, consult your lawyer to determine the legality of doing this, and any other thing that can be said to tell you to use this at your own risk.

Cease-and-Desist text: