homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Closing connection on certain hits
Is there a module to do this?

10+ Year Member

Msg#: 3089361 posted 10:52 pm on Sep 19, 2006 (gmt 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.



10+ Year Member

Msg#: 3089361 posted 3:28 am on Sep 21, 2006 (gmt 0)

I'm not sure about this as I've never tried it, but maybe a "Connection: close" header would do the trick.


10+ Year Member

Msg#: 3089361 posted 12:24 am on Sep 22, 2006 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved