The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Blocking IP's

Discussion in 'General Discussion' started by eter4, Dec 29, 2002.

  1. eter4

    eter4 Well-Known Member

    Joined:
    Feb 16, 2002
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    is there a way to block certain IP addresses from accessing the server???
     
  2. Craig

    Craig Well-Known Member

    Joined:
    Aug 10, 2001
    Messages:
    171
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    You could use ipchains..

    Its been a while but i belive the syntax to use is:

    ipchains -I input 1 -s IP-here -j DENY

    If you just want to block them from using http, use .htaccess.

    Cheers,

    Craig
     
  3. chakky

    chakky Well-Known Member

    Joined:
    Sep 22, 2002
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Hi

    Add this entry in your .htaccess and it should work

    &Limit GET POST&
    order deny,allow
    deny from IP
    allow from all
    &/Limit&

    BTW is there any use adding the ip in /etc/hosts.deny
    Theoretically it is supposed to block any access to any ports on the server if it is done so right?
    I am not sure if it is appropriate enough to be doing so.:) but if it works its easier to do than learn ipchains
     
Loading...

Share This Page