Results 1 to 5 of 5
  1. #1

    Ban IP from entire server


    Last few days I have been searching for and banning bots that were trying to SPAM guestbooks/forms/forums on my websites. I am banning them using .htaccess but the problem is I need to copy the htaccess to all websites on the server.

    How can I ban these IPs from the entire server rather than banning them from individual websites? I have CentOS 4/Apache/WHM-CPanel and root access. Not sure about firewalls though.

    Thanks in advance!

  2. #2
    Join Date
    Oct 2002
    State of Disbelief
    Have you tried iptables? As root, issue this:
    iptables -I INPUT -s xx.xx.xx.xx -j DROP

    The x's should be replaced with the actual IP address.

  3. #3
    Did you search at all? I am sure this is discussed many times over.

    You can use route:

    route add -host <ip here> lo
    Dan - Vice President - [email protected]
    BurstNET Technologies -

  4. #4

    Thanks will try that. Are there any major differences between using route or iptables?

    Actually I did search both WHT and Google but couldn't find anything specific and/or simple enough. Maybe I was just too lasy, it was 2am here

  5. #5
    Join Date
    Jul 2006
    San Diego, CA, USA
    or install apf and apf -d IP...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts