Applicable to:
- Plesk for Linux
Question
How to block custom bots on Plesk server?
Answer
It is possible to add the required bots into Fail2ban "apache-badbot" jail:
-
Go to Tools & Settings > IP Address Banning (Fail2Ban) > Jails and click on Manage Filters
-
Select apache-badbots.
-
Add the required custom bots in the "badbotscustom" value separated by a pipe, e.g.:
CONFIG_TEXT: badbotscustom = SputnikBot|omgili|socialmediascanner|Jooblebot|SeznamBot|Scrapy|CCBot|linkfluence|veoozbot|Leikibot
Fail2ban will start blocking access from both Nginx and Apache. The settings can be checked at Tools & Settings > IP Address Banning (Fail2Ban) > Jails > plesk-apache-badbot:
CONFIG_TEXT: [plesk-apache-badbot]
enabled = true
filter = apache-badbots
action = iptables-multiport[name=BadBots, port="http,https,7080,7081"]
logpath = /var/www/vhosts/system/*/logs/*access*log
/var/log/httpd/*access_log
maxretry = 1
To ensure the jail is working, check Tools & Settings > IP Address Banning (Fail2Ban) > Banned IP addresses or fail2ban log /var/log/fail2ban.log
.
Comments
0 comments
Please sign in to leave a comment.