Hướng dẫn cài mod_qos cho server CentOS!

Các bạn login vào SSH, thực hiện các command sau:

wget http://biznetnetworks.dl.sourceforge.net/project/mod-qos/9.28/mod_qos-9.28.tar.gz
tar xvfz mod_qos-9.28.tar.gz
cd mod_qos-9.28/apache2
apxs -i -c mod_qos.c
chmod 755 /usr/local/apache/modules/mod_qos.so

Sau đó tiến hành edit file httpd.conf, thêm:

LoadModule qos_module modules/mod_qos.so

Vào ngay bên dưới phần LoadModule và thêm:

Include "/usr/local/apache/conf/qos.conf"

Vào bên dưới dòng Include. Sau đó các bạn tạo file qos.conf

nano /usr/local/apache/conf/qos.conf

với nội dung như sau:

<IfModule mod_qos.c>
# maximum number of active TCP connections is limited to 256 (limited
# by the available memory, adjust the settings according to the used
# hardware):
MaxClients 256

# idle timeout:
Timeout 45

# keep alive (for up to 70% of all connections):
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 3
QS_SrvMaxConnClose 70%
QS_ClientEntries 1500

# minimum request/response speed (deny slow clients blocking the server,
# e.g. defending slowloris):
QS_SrvMinDataRate 150 1200

# don't allow more than 25 TCP connections per client source address:
QS_SrvMaxConnPerIP 25


Và save lại, sau đó restart apache.

  • 51 Users Found This Useful
Was this answer helpful?

Related Articles

Setup & disable unused services on CentOS

Step 1: Now we will remove all software groups, to get Centos to a minimum Step 1.1: Run...

install g++ on CentOS

g++ is often necessary for building various packages. But It’s quite hard to install it in...

How to Compress and Uncompress Files with SSH

Login to SSH: 1) To compress files: Examples: tar cvf abc.tar a1.ps a2.tex adir/* # compress...

Repair all tables on server with SSH

Login to SSH. Try to run this command: mysqlcheck -A -h localhost -u root -r -p It asks mysql...

scp resume after got disconnected or timeout

I often use the UNIX command line tool scp (secure copy) to copy a file to a remote server....