Apache: Enable Mod QoS
Revision as of 05:46, 14 March 2013 by Onnowpurbo (talk | contribs)
cd /tmp/ wget http://downloads.sourceforge.net/sourceforge/mod-qos/mod_qos8.13-src.tar.gz?use_mirror=freefr tar xvfz mod_qos-8.13-src.tar.gz
apt-get install apache2-threaded-dev gcc
cd mod_qos-8.13/apache2/ apxs2 -i -c mod_qos.c
cd /etc/apache2/mods-available/ vi qos.load
LoadModule qos_module /usr/lib/apache2/modules/mod_qos.so
vi qos.conf
## QoS Settings <IfModule mod_qos.c> # handles connections from up to 100000 different IPs QS_ClientEntries 100000 # will allow only 50 connections per IP QS_SrvMaxConnPerIP 50 # maximum number of active TCP connections is limited to 256 MaxClients 256 # disables keep-alive when 70% of the TCP connections are occupied: QS_SrvMaxConnClose 180 # minimum request/response speed (deny slow clients blocking the server, ie. slowloris keeping connections open without requesting anything): QS_SrvMinDataRate 150 1200 # and limit request header and body (carefull, that limits uploads and post requests too): # LimitRequestFields 30 # QS_LimitRequestBody 102400 </IfModule>
a2enmod qos /etc/init.d/apache2 restart