Control Web Panel

WebPanel => Apache => Topic started by: AlexG on December 27, 2019, 07:18:40 PM

Title: [How To] Apache Ultimate Bad Bot Blocker for CWP
Post by: AlexG on December 27, 2019, 07:18:40 PM
Hi there, previously I've written a post about this Apache Ultimate Bad Bot Blocker (http://forum.centos-webpanel.com/index.php?topic=4555.0) but for some reason I cannot edit/remove that post so I'm starting a new updated one.

1. First, login as root on your CWP server.

(https://upload.inwebxdesigns.com/hotlink-ok/cwp_apache_ultimate_bad_bot_block_login-1577473506-946.png)

2. Make a new directory for the new rules:
Code: [Select]
mkdir -p /usr/local/apache/custom.d
3. Clone git
Code: [Select]
git clone https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker.git
4. Copy Apache rules
Code: [Select]
cd /root/apache-ultimate-bad-bot-blocker/Apache_2.4/custom.d && cp -r * /usr/local/apache/custom.d
5. Replace Apache path
Code: [Select]
sed -i "s|/etc/apache2/custom.d|/usr/local/apache/custom.d|g" /usr/local/apache/custom.d/globalblacklist.conf
6. Remove unnecessary files
Code: [Select]
cd /root && rm -rf /root/apache-ultimate-bad-bot-blocker
7. Add new rule to the Apache configuration file
Code: [Select]
nano /usr/local/apache/conf/httpd.confAfter the line:
Code: [Select]
#ServerName www.example.com:80Add:
Code: [Select]
<Location "/">
# AND-combine with preceding configuration sections 
AuthMerging And
# include black list
Include /usr/local/apache/custom.d/globalblacklist.conf
</Location>

(https://upload.inwebxdesigns.com/hotlink-ok/cwp_apache_ultimate_bad_bot_block-1577473506-646.png)

Save file (Ctl+O). Exit (Ctl+X)

8. Restart Apache
Code: [Select]
service httpd restart
9. Testing
Code: [Select]
curl -A "80legs" https://your.domain.name
(https://upload.inwebxdesigns.com/hotlink-ok/cwp_apache_ultimate_bad_bot_block_testing-1577473506-794.png)

*** Works for CWP v0.9.8.924 Free & Pro. Have fun. ***