allklier

Member
Jul 29, 2015
5
0
1
New York, NY
cPanel Access Level
Root Administrator
Earlier today I recompiled Apache to include mod_qos to deal with some traffic/load problems.

Build and install went uneventful. mod_qos is showing up in Apache Status, build info, and adding <Location> /qos <Location> (not exact syntax) as describe in documentation indicates to mod_qos is running properly.

However, I've been utterly unsuccessful in configuring any of the directives to configure mod_qos. After searching much of the web, it seemed that the appropriate way on cPanel is to use 'Apache Configuration' edit the includes and add directives to pre-main global include.

However, anytime I add any mod_qos related directive it fails with a parser error that the directive is not recognized. I've tried multiple, including 'QS_LogOnly on' by itself. No luck.

If I enclose the directives with <IfModule mod_qos.c> the include file parses fine, but none of the directives appear to be executing. Clearly the <IfModule> resolves to false and simply skips them.

I must be missing some obvious and stupid step. How can it be that mod_qos is running yet doesn't seem to be loaded or active from a configuration point of view?

Here's one of the iterations of initial rules I tried (not the final set, I was just starting to get to test what might work).

<IfModule mod_qos.c>
# Observe mode only for now
QS_LogOnly on

# Default Request Limit 50 per site, per IP 20, no keep alive after 10
QS_LocRequestLimitDefault 50
QS_SrvMaxConnPerIP 20
QS_SrvMaxConnClose 70

# limit number of logins to 5 every 10min
QS_ClientEventBlockCount 20
SetEnvIf Request_URI /wp-login.php$ QS_Block=4

# Setup UA specific rules
BrowserMatch "slurp" QS_Cond=spider
BrowserMatch "googlebot" QS_Cond=spider
QS_CondLocRequestLimitMatch "^.*$" 5 spider
</IfModule>
 

allklier

Member
Jul 29, 2015
5
0
1
New York, NY
cPanel Access Level
Root Administrator
After more careful inspection of the compiled httpd.conf, it appears that the loadModule line is after the pre_main_global. So directives included in that pre_main_global conf wouldn't see the mod_qos module. Moving the directive into the pre_virtual_host_global include fixed it and it is now running.

I thought I had tried that before, but maybe not.

All good in the end. Thanks for the input and pointing me in the right direction.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,226
463
Moving the directive into the pre_virtual_host_global include fixed it and it is now running.
Hello :)

I'm happy to see the issue is now resolved. Thank you for updating us with the outcome.