Search code examples
ruby-on-railsipspam-preventionlinode

How to block an ip address from linode?


I have rails application running in linode server .Some guy is continuously spamming (writing bullsh*t in my site).Can anybody tell how to block that person ip.Any other help would be appreciated.


Solution

  • I would suggest you don't only look into blocking that one person but rather into making sure this can't happen again.

    Spams usually originate from bots that randomly try to fill in their marketing message into input fields on pages they encounter. You block one, another will find your page and continue.

    The only ways to prevent this kind of automated spam I know of are either using some sort of CAPTCHA or by securing your site through authentication.

    There are some very nice captcha gems like reCaptcha or look around in the captcha category on Ruby Toolbox and you should be up and running soon.

    If it's really a person that is annoying you with writing bad stuff to your site, while not ideal an IP block is easily set up through apache. Just put the following into your VirtualHost file inside the <Directory> node and then enable the mod_authz_host module through a2enmod authz_host

    Deny from 192.168.205