Welcome to WebmasterWorld Guest from 54.166.146.212

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Closing connection on certain hits

Is there a module to do this?

     
10:52 pm on Sep 19, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Aug 22, 2003
posts:333
votes: 0


My weblog is constantly under a stream of spam attacks. Fortunately the attacks rarely hit a working script, because over the years I've renamed scripts and put commented-out forms on my pages which throw their spamming scripts off. However a number of spammers keep hitting these absentee scripts no matter whether they get a 404, 403 or other response.

So rather than bother with serving them a response, I'd like to close the connection without sending any headers or data in order to minimise the server impact and possibly give their scripts a more direct hint. Due to the nature of the hits, I can only detect them by the URL they hit.

Are there any Apache modules which could do this? I'm using Apache 1.3.37.

3:28 am on Sept 21, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 28, 2004
posts:192
votes: 0


I'm not sure about this as I've never tried it, but maybe a "Connection: close" header would do the trick.
12:24 am on Sept 22, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Aug 22, 2003
posts:333
votes: 0


Thanks zomega. I ended up with a Perl script which did this:
print "Status: \nConnection: Close\n\n";

That closes the connection with a null status (I tried without the null status and Apache filled in a 200 status for me).

It's not a perfect solution since Apache has to process the perl script, but hopefully it'll give the spammers the mesage.