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.

Anyone know how to limit a amount of connections per i.p.?

Discussion in 'General Discussion' started by DWHS.net, Apr 13, 2005.

  1. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    I need to limit a server to only letting 4 concurrent connections per i.p. at once.

    Thank you very much for any help on this.

    -Charles
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Hi Charles,

    To any service in particular, or just to the server as a whole?
     
  3. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    I would be for apache or port 80. It's for his website so something in htaccess would be ideal.
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I don't believe that you can do it in standard apache. However, you can do it using mod_throttle I believe by using its ThrottlePolicy directive within a VirtualHost container in httpd.conf like this:
    Code:
    <IfModule mod_throttle.c>
     ThrottlePolicy Request 4 1
    </IfModule>
    A Request here is an IP address and we're limited 4 connections per 1 second:
    http://www.snert.com/Software/mod_throttle/
     
  5. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Thanks Chirpy but I am a big fan of that mod. I will just have to make due.

    Thanks again.
     
Loading...

Share This Page