WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,727
28
328
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
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.
 

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,727
28
328
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
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
Hello,

Check to ensure Mod_Env is installed on this system:

Code:
yum install ea-apache24-mod_env
Thank you.
 

MegasmorF

Registered
Apr 29, 2020
1
0
1
Greece
cPanel Access Level
Root Administrator
Hello Community
i try to set up this module to set the limits in my client account for example /home/FOLDERDOMAIN/public_html/targetfolder but i think dont work. So i set that

<IfModule ratelimit_module>
<Location "/home/FOLDERDOMAIN/public_html/TARGETFOLDER/">
SetOutputFilter RATE_LIMIT
SetEnv rate-limit 100
SetEnv rate-initial-burst 200
</Location>
</IfModule>

dont work for me. anybody help?