How to install Apache mod_limits module on CentOS WebPanel?
This apache module is aimed at protecting the web server during attacks.
It provides a few, very usefull, functionalities:
* Limit the maximum number of simultaneous connections
* Limit the maximum number of simultaneous connections per Vhost
* Limit the maximum number of spawned processes with the same UID
* Do not serve request if the load is over certain value
Install development packages
yum install apr-devel apr-util-devel apr apr-util
Download and Install Apache mod_limits module
cd /usr/local/src wget https://github.com/hackman/mod_limits/archive/master.zip unzip master.zip cd mod_limits-master /usr/local/apache/bin/apxs -a -i -c mod_limits.c
Add this configuration to file: /usr/local/apache/conf.d/mod_limits.conf
LoadModule limits_module modules/mod_limits.so <IfModule mod_limits.c> LimitMaxConnsPerVhost 20 LimitMaxConnsPerUid 20 LimitMaxConnsPerIP 80 LimitMaxLoadAVG 10 CheckLoadInterval 5 </IfModule>
* Make custom changes based on the limits you want to have set.
/usr/local/apache/conf/httpd.conf
At the end restart apache to load new changes
service httpd restart
Home page
https://github.com/hackman/mod_limits
Last testing done with apache 2.4.26.