ปกติแล้ว เรามักจะคุ้นเคยและได้ยินการโจมตีแบบ DDoS กันมาบ้างครับ mod_qos จะช่วยป้องกันเรื่องนี้ได้ เพราะเราจะสามารถจัดการจำนวน connection ที่เข้าถึง server ของเราผ่าน apache ได้ครับ
cd /usr/local/directadmin/custombuildwget http://jaist.dl.sourceforge.net/project/mod-qos/mod_qos-11.45.tar.gz
tar -zxvf mod_qos-11.45.tar.gz
cd mod_qos-11.45/apache2
apxs -cia mod_qos.c
เพิ่ม config เข้าไปในไฟล์ /etc/httpd/conf/extra/httpd-includes.conf ดังนี้
(สามารถปรับแต่งได้เองครับ)
vi /etc/httpd/conf/extra/httpd-includes.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      70%
   # 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>
service httpd restart