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.

IP limit

Discussion in 'General Discussion' started by parag joshi, Jul 17, 2009.

  1. parag joshi

    parag joshi Well-Known Member

    Joined:
    Sep 2, 2008
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    How do i set a limit to the number of hits from one IP?

    Please advise.
     
  2. logicsupport

    logicsupport Well-Known Member

    Joined:
    Jun 5, 2007
    Messages:
    138
    Likes Received:
    0
    Trophy Points:
    16
    How to limit simultaneous connections from a single IP

    Hi,

    You can use the limitipconn apache module to limit the number of simultaneous downloads permitted from a single IP address

    You can try the following steps to configure this module ( for Apache 2.X )

    1) Download and untar the latest version of mod_limitipconn.tar.gz

    2) compile and install the module using apxs as follows

    /usr/local/apache/bin/apxs -cia mod_limitipconn.c

    Add following line to /usr/local/apache/conf/httpd.conf , inside the virtual host of your domain

    <IfModule mod_limitipconn.c>
    <Location />

    MaxConnPerIP 3

    </Location>
    </IfModule>

    then restart apache

    Hope this helps
     
  3. parag joshi

    parag joshi Well-Known Member

    Joined:
    Sep 2, 2008
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    What about large no of domains.

    How do i set a limit to the number of hits from one IP to large no of domains?

    Please advise
     
  4. logicsupport

    logicsupport Well-Known Member

    Joined:
    Jun 5, 2007
    Messages:
    138
    Likes Received:
    0
    Trophy Points:
    16
    Hi Parag,

    You need to insert this in the virtual host section of each domain in httpd.conf

    for example:-

    <Virtualhost X.X.X.X:80>
    ServerName abc.com
    <IfModule mod_limitipconn.c>
    <Location />
    MaxConnPerIP 3
    </Location>
    </IfModule>
    </Virtualhost >



    <Virtualhost X.X.X.X:80>
    ServerName yourdomain.com
    <IfModule mod_limitipconn.c>
    <Location />
    MaxConnPerIP 5
    </Location>
    </IfModule>
    </Virtualhost>
     
  5. parag joshi

    parag joshi Well-Known Member

    Joined:
    Sep 2, 2008
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    Is there any option for many no of domain?

    Can put many domain in 1 virtual host section?

    Please advise.
     
  6. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    The following will install mod_limitipconn for all domains and limit to 3 connections per IP for audio/mpeg video application/zip application/octet-stream :

    Code:
    cd /usr/src/
    wget http://dominia.org/djao/limit/mod_limitipconn-0.23.tar.bz2
    tar xjvf mod_limitipconn-0.23.tar.bz2
    cd mod_limitipconn-0.23
    replace "APXS=apxs" "APXS=/usr/local/apache/bin/apxs" -- /usr/src/mod_limitipconn-0.23/Makefile
    make
    make install
    /usr/local/cpanel/bin/apache_conf_distiller --update
    echo -e '\n<IfModule mod_limitipconn.c>\n<Location />\nMaxConnPerIP 3\nOnlyIPLimit audio/mpeg video application/zip application/octet-stream\n</Location>\n</IfModule>' >> /usr/local/apache/conf/userdata/limitip.conf
    /usr/local/cpanel/bin/build_apache_conf
    service httpd restart
     
Loading...

Share This Page