how do I block my rails app from being hit by bots?

Posted by codeman73 on Stack Overflow See other posts from Stack Overflow or by codeman73
Published on 2010-03-10T19:02:27Z Indexed on 2010/03/11 4:39 UTC
Read the original article Hit count: 184

Filed under:
|

I'm not even sure I'm using the right terminology, whether this is actually bots or not. I didn't want to use the word 'spam' because it's not like I have comments or posts that are being created/spammed. It looks more like something is making the same repeated request to my domain, which is what made me think it was some kind of bot.

I've opened my first rails app to the 'public', which is a really a small group of users, <50 currently. That was last Friday. I started having performance issues today, so I looked at the log and I see tons of these RoutingErrors

ActionController::RoutingError (No route matches "/portalApp/APF/pages/business/util/whichServer.jsp" with {:method=>:get}):

They are filling up the log and I'm assuming this is causing the slowdown. Note the .jsp on the end and this is a rails app, so I've got no urls remotely like this in my app. I mean, the /portalApp I don't even have, so I don't know where this is coming from.

This is hosted at Dreamhost and I chatted with one of their support people, and he suggested a couple sites that detail using htaccess to block things. But that looks like you need to know the IP or domain that the requests are coming from, which I don't.

How can I block this? How can I find the IP or domain from the request? Any other suggestions?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about Performance