How to protect against DDOS on VPS 06-10-2015, 08:49 AM
#1
These Denial Of Service attacks can be prevented easily by installing mod_evasive Similar to mo_security it's useful.
Run
Make the log directory
Change the permissions
Create the config file and configure it
Add the following to the file
Fix the email bug
Check to see if it's enabled
Then restart apache
Run
Code:
sudo apt-get install libapache2-mod-evasiveMake the log directory
Code:
sudo mkdir /var/log/mod_evasiveChange the permissions
Code:
sudo chown www-data:www-data /var/log/mod_evasive/Create the config file and configure it
Code:
sudo vi /etc/apache2/mods-available/mod-evasive.confAdd the following to the file
Code:
<ifmodule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
DOSLogDir /var/log/mod_evasive
DOSEmailNotify EMAIL@DOMAIN.com
DOSWhitelist 127.0.0.1
</ifmodule>Fix the email bug
Code:
sudo ln -s /etc/alternatives/mail /bin/mail/Check to see if it's enabled
Code:
sudo a2enmod mod-evasiveThen restart apache
Code:
service apache2 restart
(This post was last modified: 06-10-2015, 08:53 AM by EquinoxRhyme.)



![[+]](https://sinister.li/images/modern/collapse_collapsed.png)