Author Topic: Apache Bad Bot and User-Agent Blocker, Spam Referrer Blocker, Bad IP Blocker  (Read 7955 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Hi everyone, it's a good idea to add this custom module to apache, right?

https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker

Anyone interested?

Offline
***
mkdir -p /usr/local/apache/custom.d
git clone https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker.git
cd /root/apache-ultimate-bad-bot-blocker/Apache_2.4/custom.d
cp -r * /usr/local/apache/custom.d

nano /usr/local/apache/custom.d/globalblacklist.conf

press ctrl+w and ctrl+r

type
/etc/apache2/custom.d

replace with
/usr/local/apache/custom.d


navigate to
https://youip:2087/admin/index.php?module=vhost_tpl

Add Include /usr/local/apache/custom.d/globalblacklist.conf under the code below

<Directory "PATH_REPLACE">
      AllowOverride All
      /usr/local/apache/custom.d/globalblacklist.conf
   </Directory>
   
Rebuild Apache Vhost
https://yourip:2087/admin/index.php?module=vhost_rebuild

Restart Apache
server httpd restart


Test to see if its working

curl -I http://yourserverip -e http://100dollars-seo.com


Error

HTTP/1.1 403 Forbidden
Date: Sat, 10 Feb 2018 18:18:57 GMT
Server: Apache/2.4.28 (Unix) PHP/5.6.33 OpenSSL/1.0.1e-fips
Content-Type: text/html; charset=iso-8859-1


Offline
*
Hi @bullten, that work perfectly sir, thank you.

Just one change, you can avoid the whole nano editing with this single command line:

Code: [Select]
sed -i "s|/etc/apache2/custom.d|/usr/local/apache/custom.d|g" /usr/local/apache/custom.d/globalblacklist.conf
So, this work for me:

Code: [Select]
mkdir -p /usr/local/apache/custom.d && git clone https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker.git && cd /root/apache-ultimate-bad-bot-blocker/Apache_2.4/custom.d && cp -r * /usr/local/apache/custom.d && sed -i "s|/etc/apache2/custom.d|/usr/local/apache/custom.d|g" /usr/local/apache/custom.d/globalblacklist.conf
Navigate to Apache Settings > Apache vHost Template
https://youip:2087/admin/index.php?module=vhost_tpl

Add this line:
Code: [Select]
Include /usr/local/apache/custom.d/globalblacklist.confunder the code below

<Directory "PATH_REPLACE">
      AllowOverride All
      Include /usr/local/apache/custom.d/globalblacklist.conf
   </Directory>
   
Rebuild Apache Vhost
https://yourip:2087/admin/index.php?module=vhost_rebuild

Restart Apache
Code: [Select]
server httpd restart
That's it.

**UPDATE**
After almost an hour with this custom module activated, my server load was reduced from 1.75 - 2.30 to 0.30 - 0.12
Code: [Select]
11:18:35 up 6 days, 21:03,  1 user,  load average: 0.12, 0.23, 0.33
« Last Edit: February 14, 2018, 04:23:15 PM by AlexG »

Offline
***
Perfect thanks for updating this thread :)