SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Block an IP Address

    What's the best way to block someone spamming from a given IP address?

  2. #2
    SitePoint Evangelist Andrewaclt's Avatar
    Join Date
    Dec 2003
    Location
    Raleigh, NC
    Posts
    535
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are many ways to block a user from accessing your site, it really depends on how you want to handle it. You can configure a firewall, such as iptables to drop their ip, or you can let apache handle. You could even include some specific php in each page to handle the offending IPs.

    If you want to handle it with iptables: http://www.netadmintools.com/art216.html

    If you want to handle it at the apache level, look at: http://httpd.apache.org/docs/2.2/howto/access.html

    If you want to handle it at the application level:
    http://httpguru.com/php-mysql/block-...ress-with-php/

    The "best" way is really hard to say without knowing specifics, type of spam, etc.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Location
    Everett WA
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Blocking a specific IP address is only really recommended for a quick band-aid to a serious situation. I would suggest a solution that includes using an RBL list or 2. A spammer will not confine himself to one IP address, but move on again and again like a cancer infecting and exploiting different places on the internet. These days they usually employ a large group of locations to send their spam from. To give you a more specific solution I would need to have more information about what type of server you are on.
    Jonathan Kinney
    Data Systems Specialist
    Advantagecom Networks, Inc.
    http://www.simplywebhosting.com

  4. #4
    SitePoint Addict
    Join Date
    Jul 2008
    Location
    sudo rm -rf /
    Posts
    386
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    linux: iptables -I INPUT -s 10.12.12.2 -j DROP

    windows: don't know.

  5. #5
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would also consider setting up regional list to block regions like ips from known spamming countries and such. It stops a lot of traffic.


Bookmarks

Posting Permissions

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