I have installed www/mod_qos to enable me to resist robotic attempts to find weaknesses in my set-up by spamming with hundreds of requests for hacks at a time by limiting accesses and connections from any one IP at a time.
Unfortunately, I have a script which checks my certificate for renewal every morning which requests a graceful restart of Apache and with mod_qos installed that crashes Apache. Apache will restart fully but not gracefully.
The only clue is three lines in /var/log/httpd-error.log:
Unfortunately, my sites rely heavily on PHP scripting and Event and Worker are incompatible with
www/mod_php. A quick look at php-fpm suggests it could be a security nightmare for self-hosted website admins.
Am I right in thinking mod_php and mod_qos cannot be used together, or do I just have to avoid graceful restarts?
Update: mod_qos seems to work as long as Apache doesn't attempt a graceful restart. As I can't guarantee to ensure nothing triggers that (something unidentified sent it a SIGHUP at noon today - maybe a newsyslog event or similar) and I have a script monitoring its logs approximately every second, I worked around the problem by adding a status check and conditional start if Apache is not running to that script. This should keep site down time to about a second, which should have minimal impact on people accessing it.
It would still be good to know whether there's a proper solution though. Workarounds are always second best.
Unfortunately, I have a script which checks my certificate for renewal every morning which requests a graceful restart of Apache and with mod_qos installed that crashes Apache. Apache will restart fully but not gracefully.
The only clue is three lines in /var/log/httpd-error.log:
Code:
[Tue Oct 06 10:37:47.289645 2026] [mpm_prefork:notice] [pid 3983] AH00171: Graceful restart requested, doing restart
[Tue Oct 06 10:37:47.673417 2026] [qos:notice] [pid 3983] mod_qos(009): loaded MPM is 'prefork' but mod_qos should be used with MPM 'Worker' or 'Event' only.
[Tue Oct 06 10:37:47.676166 2026] [qos:emerg] [pid 3983] mod_qos(004): failed to create mutex (ACT)(/tmp/K075352263.mod_qos): File exists
Unfortunately, my sites rely heavily on PHP scripting and Event and Worker are incompatible with
www/mod_php. A quick look at php-fpm suggests it could be a security nightmare for self-hosted website admins.
Am I right in thinking mod_php and mod_qos cannot be used together, or do I just have to avoid graceful restarts?
Update: mod_qos seems to work as long as Apache doesn't attempt a graceful restart. As I can't guarantee to ensure nothing triggers that (something unidentified sent it a SIGHUP at noon today - maybe a newsyslog event or similar) and I have a script monitoring its logs approximately every second, I worked around the problem by adding a status check and conditional start if Apache is not running to that script. This should keep site down time to about a second, which should have minimal impact on people accessing it.
It would still be good to know whether there's a proper solution though. Workarounds are always second best.
