Installation on Arch Linux
Since mod_evasive is in AUR (Archlinux User Repository) you need to build the package and then install it via ‘pacman’. This can be accomplished either by using some AUR wrapper like ‘packer’, ‘yaourt’, ‘cower’ etc… or by building the package manually via makepkg and then installing it via ‘pacman’.
We are going to use the ‘makepkg’ method here because those wrappers are all based on ‘makepkg’ and ‘pacman’, so create the build directory:
mkdir -p /home/build/ && cd /home/build/
download the tar package containing the PKGBUILD for mod_evasive:
wget
http://aur.archlinux.org/packages/mo/mod_evasive/mod_evasive.tar.gz
extract the tarball and change to the extracted directory by executing:
tar zxvf mod_evasive.tar.gz && cd mod_evasive/
before you proceed with building the package, make sure you have GCC installed on your Arch Linux VPS:
pacman -Sy gcc
then proceed with building and installing the mod_evasive package:
makepkg -si --asroot
Once the installation is finished, proceed with creating a configuration for mod_evasive by executing:
echo 'LoadModule evasive20_module modules/mod_evasive20.so' > /etc/httpd/conf/extra/mod_evasive.conf
cat >> /etc/httpd/conf/extra/mod_evasive.conf <<EOF
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 5
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 60
DOSEmailNotify
your@email.com
DOSLogDir /var/lock/mod_evasive
</IfModule>
EOF
echo -e "# Include mod_evasive options\nInclude conf/extra/mod_evasive.conf" >> /etc/httpd/conf/httpd.conf
rc.d restart httpd