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.

Limit connections per ip

Discussion in 'General Discussion' started by surfweb, Nov 14, 2006.

  1. surfweb

    surfweb Registered

    Joined:
    Nov 14, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I'm new user of cPanel with RHE v4 and Apapche 1.3.

    I'm going to start a membership movie site and want to limit connections to video
    files per ip because they give a server heavy load.

    I knew there was a module to enable this configurations but the link has gone now.:(
    http://dominia.org/djao/limitipconn.html
    This module enabled that only 1 access was allowed per one ip at the same time.

    Does anyone know the module to enable it?

    Any advise would be appreciated.

    Thank you.

    surfweb
     
  2. sssathish

    sssathish Member

    Joined:
    Jul 19, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Madurai, Tamil Nadu, India
    Hi,

    Installing mod_limitipconn.c

    This is the apache module mod_limitipconn.c, which
    allows web server administrators to limit the number of simultaneous downloads permitted from a single IP address.

    =================
    Log into ssh

    cd /usr/src
    wget http://dominia.org/djao/limit/mod_li...nn-0.04.tar.gz
    tar xzvf mod_limitipconn-0.04.tar.gz
    cd mod_limitipconn-0.04

    pico Makefile
    find the line that reads APXS=apxs[/b]
    change that to
    APXS=/usr/local/apache/bin/apxs

    press cntrl O to save
    then cntrl X

    // if your locations to apxs is different
    locate apxs and copy the path
    then paste that in
    //

    make
    make install

    service httpd restart

    pico -w /etc/httpd/conf/httpd.conf

    locate ExtendedStatus
    Make sure ExtendedStatus is on and without the comment at the start

    and add this line to every virtual directory you want to limit
    or add it once to the main directory to limit all

    <IfModule mod_limitipconn.c>
    <Location /somewhere>
    MaxConnPerIP 3
    # exempting images from the connection limit is often a good
    # idea if your web page has lots of inline images, since these
    # pages often generate a flurry of concurrent image requests
    NoIPLimit image/*
    </Location>

    <Location /mp3>
    MaxConnPerIP 1
    # In this case, all MIME types other than audio/mpeg and video*
    # are exempt from the limit check
    OnlyIPLimit audio/mpeg video
    </Location>
    </IfModule>

    press cntrl O to save
    then cntrl X
    then service httpd restart :)
     
  3. surfweb

    surfweb Registered

    Joined:
    Nov 14, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Re: mod_limitipconn.c

    Hello,

    Thank you for explaining in detail for me.
    Unfortunately this site seems to be down.

    http://dominia.org/djao/limit/mod_li...nn-0.04.tar.gz

    Could you upload somewhere this module or sent me by email if you have?

    I need mod_limitipconn.c for Apache 1.3 and 2.0.
    Here is an original google cache links:
    http://www.google.com/search?q=cach...conn.html&hl=en&gl=us&ct=clnk&cd=1&lr=lang_en
    http://www.google.com/search?q=cach...ao/limitipconn2.html&hl=ja&gl=jp&ct=clnk&cd=1

    but cannot download the module at all.:(

    surfweb
     
    #3 surfweb, Nov 15, 2006
    Last edited: Nov 15, 2006
  4. sssathish

    sssathish Member

    Joined:
    Jul 19, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Madurai, Tamil Nadu, India
  5. surfweb

    surfweb Registered

    Joined:
    Nov 14, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I appreciate you from my heart!
    And http://dominia.org/djao/ has been back now.:D

    http://dominia.org/djao/limit/mod_limitipconn-0.22.tar.gz
    seems to work only with Apache 2.0.
    http://dominia.org/djao/limitipconn2.html

    Does mod_limitipconn-0.22.tar.gz work with Apache 1.3 too as
    http://dominia.org/djao/limit/mod_limitipconn-0.04.tar.gz ?

    http://dominia.org/djao/limitipconn.html

    Thank you.:)
     
  6. BG06

    BG06 Member

    Joined:
    Oct 20, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    How can I check that this is really working? Apache is running after installation so the configuration should be ok but I can't see no restrictions of connections.

    I tried to simply catch everything using FlashGet and netstat showed me 85 open tcp connections.

    I am using 3 connections limit..
     
  7. BG06

    BG06 Member

    Joined:
    Oct 20, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    It is not working for me. This if from the httpd.conf:

    IP and domain name was changed..
     
  8. abrender

    abrender Active Member

    Joined:
    Dec 5, 2002
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Does anyone know if cpanel Apache can be easily modified with the limitipcon patch to allow limiting on a per vhost basis?

    Thanks
     
  9. rustelekom

    rustelekom Well-Known Member
    PartnerNOC

    Joined:
    Nov 13, 2003
    Messages:
    290
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    moscow
    Because you use Apache 1.3.xx i recommend you mod_ipdrop (http://miksir.pp.ru/?r=65). it is best of the best apache modules specialy designed for preventing flood attack. Installation is very easy as well as setup.
     
  10. PbG

    PbG Well-Known Member

    Joined:
    Mar 11, 2003
    Messages:
    241
    Likes Received:
    0
    Trophy Points:
    16
    Do these instructions still apply now that we have to use Easy Apache3?

     
Loading...

Share This Page