Welcome to UltratechHost Forum, Guest. Please take the time to register if you haven't, or click

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
protecting apache with mod qos to prevent ddos attacks of slowloris

Protecting Apache with Mod_QOS to Prevent DDOS Attacks of Slowloris
#1
Apache being the dinosaur that it is prone to a host of denial of service attacks. A common form of attack refered to as HTTP flooding (for example Slowloris) exploits Apache’s architecture.

Installing and setting up Mod_QOS

Firstly we will download Mod_QOS:

Code:
cd /tmp
wget http://kent.dl.sourceforge.net/project/mod-qos/mod_qos-9.57.tar.gz
apt-get install apache2-threaded-dev gcc

Untar the archive:

Code:
tar -xvf mod_qos-9.57.tar.gz
cd mod_qos-9.57/apache2

We will now install the plugin:
Code:
apxs2 -i -c mod_qos.c

Configuration:

Code:
cd /etc/apache2/mods-available/
nano qos.load

Add the following to qos.load:

Code:
LoadModule qos_module /usr/lib/apache2/modules/mod_qos.so

and add the following / configure it yourself qos.conf (nano qos.conf):

PHP Code:
# 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 

And finally activate the plugin:

a2enmod qos
Code:
/etc/init.d/apache2 restart



Dinesh Kumar Mohanty
Ultra Web Solutions®
Bhubaneswar, Odisha, India.

UltratechHost - Your One Stop Offshore & Onshore Hosting Provider
Server Locations : Netherlands, Germany, Russia, Singapore & USA
Service Offers: Shared hosting | Reseller hosting | Cloud server | Dedicated server | VPS Hosting



Forum Jump:


Users browsing this thread: 1 Guest(s)