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.

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,612
    Likes Received:
    11
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,167
    Likes Received:
    1,295
    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.
     
  3. WebHostPro

    WebHostPro Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,612
    Likes Received:
    11
    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!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,167
    Likes Received:
    1,295
    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.
     
  5. WebHostPro

    WebHostPro Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,612
    Likes Received:
    11
    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!
     
    cPanelMichael likes this.
Loading...

Share This Page