Story:
I have my drupal site hosted in aws. Initially there were so many spam registrations occured. I prevented this completely by google recaptcha. By checking the recent logs in drupal I see the registrations comes from 2 ip address repeatedly.
Steps I tried to block IP:
1) Added the code to htaccess:
order allow,deny
deny from ***.**.**.*
deny from ***.**.**.*
allow from all
When i give these 2 ip address in the htaccess, the site shows Forbidden(tried from other systems too). When I give some other ip i am able to access the site.
2) Drupal ip blocking configuration When I give these 2 ip address , it says not a valid ip address. Every other ip address it accepts. Then I tried to add sample ip and changed the ip address from the db table 'blocked_ips', then when I load the site, it says it is blocked.
From the drupal log i could see that the hacker is trying to create spam contents. I need to block their IP address. They have prevented me to do so somehow, thats why the above steps do not work.
Something strange is going on. Any ideas to prevent this. All welcome.
reverse_proxy
toTRUE
and have your load balancer IP in$conf['reverse_proxy_addresses']
in your settings.php? If not, you may want to do that first, then you might get totally different (The real) IP's of the attackers. Sounds like your configuration is a little off.