0

I'm using Apache,hosted on Linux.

2 Answers2

3

/sbin/iptables -I INPUT -s A.B.C.D -j DROP

womble
  • 96,255
  • 29
  • 175
  • 230
3

womble's answer will block these users from even sending requests tou your server. If you want them to see the 403 Access Denied Apache error page, put this in .htaccess file:

order allow,deny
deny from 192.168.44.201
allow from all
kolypto
  • 11,058
  • 12
  • 54
  • 66
  • The problem with this solution is it will only fix a single vhost/site. Using womble's solution is server-wide and much more efficient. – Keiran Holloway Dec 09 '09 at 07:32
  • 1
    @Keiran: they're very different solutions; if you're using multiple vhosts, obviously you'd need to include this multiple places. the solution stands tho: if you want the IP to see an Apache error, you need to block it in Apache. if you don't want traffic from the IP going anywhere, the iptables solution is appropriate. – quack quixote Dec 09 '09 at 08:39
  • This solution is good and will work even if you have several vhosts. Just put it in the global configuration file, not in a .htaccess. – bortzmeyer Dec 22 '09 at 20:21