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.

Restricted Access by IP [moved]

Discussion in 'Database Discussions' started by doubledome, Oct 12, 2005.

  1. doubledome

    doubledome Member

    Joined:
    Sep 14, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Restricted Access by IP

    Hi All,

    I'm trying to restrict access to one of my cPanel sites by using .htaccess and a list of IP addresses and ranges.

    I know I can use "Allow from xxx.xxx.xxx.xxx"

    and

    "Allow from xxx.xxx.xxx."

    but what if I want to restrict the IP range to something like xxx.xxx.xxx.130 - xxx.xxx.xxx.132?

    I know I can block IP's through cPanel, but I haven't see a way to allow access via cPanel if that's possible that info would be great as well.

    Thanks,
    cab
     
  2. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
  3. doubledome

    doubledome Member

    Joined:
    Sep 14, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Thanks bamasbest,

    I've been to the Apache site. Perhaps I'm missing something in their explanation. I know I can us

    the ip xxx.xxx.xxx.xxx

    and I can leave off the last 3 for xxx.xxx.xxx to get 0-255 to gain access, but what if I only want xxx.xxx.xxx.25 through xxx.xxx.xxx.274?
     
  4. carlosferns2004

    carlosferns2004 Active Member

    Joined:
    May 5, 2005
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    india
    Hi

    Hello

    There is a ip deny manager option in the control panel
    which will help u out to resolve the problem.







    Regards
    Carlos
    http://indiaaccess.com (Web Hosting Company)
     
  5. maxm

    maxm Registered

    Joined:
    Nov 29, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    IP BLOCK in deny from finaly answered.

    Well after a bit of trial and error and some research I have the "correct" way to block IP's via .htaccess. This has been asked a lot but never answered the way I believed we needed it answered.

    To block a range of IP's from a provider or just a large block that abuse my servers greatly I used the following based upon the actual IP's of concern. The following example is my largest IP block currently in use and entering these one at a time was a joke.

    I needed to block IP's from 196.207.192.0 to 196.207.255.255 (a access provider in Senegal) and have been using the useless IP Deny manager 1 at a time. This never worked as my desired method, but was fast and quick for a few IP's. I did not want to block them from the whole site (and certainly not the whole server with IP tables), I just needed to stop them from signing up as a registered user and using the system for abuse as a member (we are a free membership site and this has always been a concern).

    I know use separate .htaccess files where I NEED THEM and not server wide.

    In my cgi_bin under members directory (where I use template files for access by the database) I added the above IP's as;

    deny from 196.207.192.0 196.207.255.255

    (notice the "space" between the two blocks. No "." no"/" and no wasted time adding them one at a time or larger groupings of IP's from decent providers.

    This deny from blocks all the IP's from the particular provider in this area and uses only one line of code and can be placed anywhere where you are having problems.

    I HOPE this helps. This has since saved me several hours a day weeding out useless criminals in troubled areas.

    I currently have many locations blocked via this route and am hopeful it saves my fellow webmasters some time and trouble without compromising their whole server for a few bad apples.

    However if someone has a better cure I would love to have it as all I have since for answers to this particular question were NOT helpful and most were sarcastic or simple to broad.

    Tony
     
Loading...

Share This Page