Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Configuring ratelimit module question

Discussion in 'EasyApache' started by WebHostPro, Feb 9, 2017.

  1. WebHostPro

    WebHostPro Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,651
    Likes Received:
    15
    Trophy Points:
    318
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Twitter:
    I added ratelimit in the Easy Apache 4 but can't find were to add the vhost details:

    <IfModule mod_ratelimit.c>
    <Location />
    SetOutputFilter RATE_LIMIT
    SetEnv rate-limit 512
    SetEnv rate-initial-burst 625
    </Location>
    </IfModule>

    I tried in the config file 350_mod_ratelimit.conf But got an error restarting apache.

    I also tried in each section of the Include Editor in WHM and each one gave an error as will.

    Where does the vhost details go?

    Thanks,
    Charles
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,378
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you want that entry added to all virtual hosts? If so, you'd create the following file and populate it:

    Code:
    /etc/apache2/conf.d/userdata/350_mod_ratelimit.conf
    Then, run the following command:

    Code:
    /scripts/rebuildhttpdconf
    Could you let us know what error message you receive when completing these steps?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. WebHostPro

    WebHostPro Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,651
    Likes Received:
    15
    Trophy Points:
    318
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Twitter:
    Great, I'm getting closer now.

    The error now is:

    Rebuilding configuration without any local modifications.

    Failed to generate a syntactically correct Apache configuration.
    Bad configuration file located at /etc/apache2/conf/httpd.conf.work.3utHn4JX
    Error:
    The â/usr/sbin/httpdâ
    Configuration problem detected on line 3 of file /etc/apache2/conf.d/userdata/350_mod_ratelimit.conf: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration

    --- /etc/apache2/conf.d/userdata/350_mod_ratelimit.conf ---
    1<IfModule mod_ratelimit.c>
    2 <Location />
    3 ===> SetOutputFilter RATE_LIMIT <===
    4 SetEnv rate-limit 512
    5 SetEnv rate-initial-burst 625
    6 </Location>
    7</IfModule>
    --- /etc/apache2/conf.d/userdata/350_mod_ratelimit.conf ---


    The code I entered is:

    <IfModule mod_ratelimit.c>
    <Location />
    SetOutputFilter RATE_LIMIT
    SetEnv rate-limit 512
    SetEnv rate-initial-burst 625
    </Location>
    </IfModule>

    Which is suggested from the site tat makes the mod.

    mod_ratelimit - Apache HTTP Server Version 2.5

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,378
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Check to ensure Mod_Env is installed on this system:

    Code:
    yum install ea-apache24-mod_env
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. WebHostPro

    WebHostPro Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,651
    Likes Received:
    15
    Trophy Points:
    318
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hole moly, that did it. No errors on Apache reboot. Hopefully this thing will work now. What a great tool!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice