A
A
Akram2017-05-16 14:21:45
linux
Akram, 2017-05-16 14:21:45

Is there an analogue of fail2ban for shared hosting?

On hosting, there is often an excess of load - various kinds of bots come. Some of them are completely inadequate, as a result, the load jumps up to 3-4 times the maximum permitted level. On vds, just set fail2ban and the issue is removed. How to solve the problem on virtual hosting?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Host-Eiweb, 2017-05-16
@Host-Eiweb

There is also a .htaccess file

<FilesMatch "^.*$">
Order Allow,Deny
Allow from all
Deny from env=search_bot
</FilesMatch>

SetEnvIfNoCase User-Agent "^Yandex" search_bot
SetEnvIfNoCase User-Agent "^Yahoo" search_bot
SetEnvIfNoCase User-Agent "^Googlebot" search_bot
SetEnvIfNoCase User-Agent "^Aport" search_bot
SetEnvIfNoCase User-Agent "^msnbot" search_bot
SetEnvIfNoCase User-Agent "^spider" search_bot
SetEnvIfNoCase User-Agent "^Robot" search_bot
SetEnvIfNoCase User-Agent "^php" search_bot
SetEnvIfNoCase User-Agent "^Mail" search_bot
SetEnvIfNoCase User-Agent "^bot" search_bot
SetEnvIfNoCase User-Agent "^igdeSpyder" search_bot
SetEnvIfNoCase User-Agent "^Snapbot" search_bot
SetEnvIfNoCase User-Agent "^WordPress" search_bot
SetEnvIfNoCase User-Agent "^BlogPulseLive" search_bot
SetEnvIfNoCase User-Agent "^Parser" search_bot

<FilesMatch "^.*primer\.html$">
Order Allow,Deny
Allow from all
Deny from env=search_bot
</FilesMatch>

SetEnvIfNoCase User-Agent "^Googlebot" search_bot
SetEnvIfNoCase User-Agent "^Yandex" search_bot
SetEnvIfNoCase User-Agent "^Yahoo" search_bot

In that case, write:
SetEnvIfNoCase Remote_Addr 123\.123\.123\.123 search_bot

S
sim3x, 2017-05-16
@sim3x

If there is no access to nginx conf, then there is no way, except to code shit in index.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question