Control Web Panel
WebPanel => Apache => Topic started 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:
mkdir -p /usr/local/apache/custom.d
3. Clone git
git clone https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker.git
4. Copy Apache rules
cd /root/apache-ultimate-bad-bot-blocker/Apache_2.4/custom.d && cp -r * /usr/local/apache/custom.d
5. Replace Apache path
sed -i "s|/etc/apache2/custom.d|/usr/local/apache/custom.d|g" /usr/local/apache/custom.d/globalblacklist.conf
6. Remove unnecessary files
cd /root && rm -rf /root/apache-ultimate-bad-bot-blocker
7. Add new rule to the Apache configuration file
nano /usr/local/apache/conf/httpd.conf
After the line:
#ServerName www.example.com:80
Add:
<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
service httpd restart
9. Testing
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. ***