[How To] Apache Ultimate Bad Bot Blocker for CWP

Started by AlexG, December 27, 2019, 07:18:40 PM

Previous topic - Next topic

AlexG

Hi there, previously I've written a post about this Apache Ultimate Bad Bot Blocker 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.



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>




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

8. Restart Apache
service httpd restart

9. Testing
curl -A "80legs" https://your.domain.name



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