Archive for March 13th, 2016

13
Mar

apache mod_qos

   Posted by: admin    in Mẹo vặt của hiếu râu

$ wget http://sourceforge.net/projects/mod-qos/files/latest/download

cd tools

./configure make make install

(replace automake-1.14 with -1.11)

$ cd mod_qos-10.15/apache2/
$ apxs2 -i -c mod_qos.c

[root@us conf.d]# cat qos.conf

LoadModule qos_module modules/mod_qos.so

# minimum request rate (bytes/sec at request reading):

QS_SrvRequestRate                                 120

# limits the connections for this virtual host:

QS_SrvMaxConn                                     100

# allows keep-alive support till the server reaches 600 connections:

QS_SrvMaxConnClose                                60

# allows max 50 connections from a single ip address:

QS_SrvMaxConnPerIP                                 25

# disables connection restrictions for certain clients:

#QS_SrvMaxConnExcludeIP                    172.18.3.32

#QS_SrvMaxConnExcludeIP                    192.168.10.

# allows not more than 20 events/penalty points per 10 minutes:

QS_ClientEventBlockCount                          20

# don’t allow a client to access /app/start.html more than

# 20 times within 10 minutes:

#SetEnvIf     Request_URI /app/start.html          QS_Block=1

# don’t allow more than 4 “403″ status code responses

# (forbidden) for a client within 10 minutes:

QS_SetEnvIfStatus        403                      QS_Block=5

QS_SetEnvIfStatus        301                      QS_Block=2

[root@us conf.d]#