• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Bug: fail2ban not working?

Azurel

Silver Pleskian
I have only tried to "switch on" the jail item "apache-badbots" and get a red box with:

Unable to switch on the selected jails: f2bmng failed: ERROR No file(s) found for glob /var/www/*/logs/access_log
ERROR Failed during configuration: Have not found any log file for apache-badbots jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration
.
 
This isn't really a bug but rather the default file path for the jail doesn't exist on your system. Try changing your log paths for the apache-badbots Jail to:

/var/www/vhosts/system/*/logs/*access_log
/var/log/httpd/*access_log

To do this, click on the jail itself, click "Change Settings" and in the log path file, paste the two path values you see above. Click OK and then try to turn on the jail.

Please post back here with your results!
 
Thanks, but that is not the only error:

After modify
/var/www/*/logs/access_log

I set all jails "switch on" and get now this:
Unable to switch on the selected jails: f2bmng failed: WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
WARNING 'actioncheck' not defined in 'Definition'. Using default one: ''
WARNING 'actioncheck' not defined in 'Definition'. Using default one: ''
WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
WARNING 'actionstart' not defined in 'Definition'. Using default one: ''
WARNING 'actionstop' not defined in 'Definition'. Using default one: ''
WARNING 'actioncheck' not defined in 'Definition'. Using default one: ''
WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
WARNING 'ignoreregex' not defined in 'Definition'. Using default one: ''
ERROR No file(s) found for glob /var/log/mysqld.log
ERROR Failed during configuration: Have not found any log file for mysqld-iptables jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration
.
 
Is this the stock Fail2Ban module installation from Parallels installed via Plesk or did you install this on your own?
 
Its 100% fail2ban module from plesk 12. I never before use this one.

Unable to switch on the selected jails: f2bmng failed: WARNING 'actioncheck' not defined in 'Definition'. Using default one: ''
WARNING 'actioncheck' not defined in 'Definition'. Using default one: ''
ERROR No file(s) found for glob /var/log/sshd.log
ERROR Failed during configuration: Have not found any log file for ssh-iptables-ipset4 jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration

fail2ban is not workable for me.
 
Last edited:
Thats not help. Thats fail2ban from plesk! I have deinstalled this component and installed again, but get still the same errors:

3proxy
Unable to switch on the selected jails: f2bmng failed: ERROR No file(s) found for glob /var/log/3proxy.log
ERROR Failed during configuration: Have not found any log file for 3proxy jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration

apache-badbots
=> started

apache-modsecurity
Unable to switch on the selected jails: f2bmng failed: ERROR No file(s) found for glob /var/log/apache*/*error.log
ERROR No file(s) found for glob /home/www/myhomepage/error.log
ERROR Failed during configuration: Have not found any log file for apache-modsecurity jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration

apache-nohome
Unable to switch on the selected jails: f2bmng failed: ERROR No file(s) found for glob /var/log/apache*/*error.log
ERROR No file(s) found for glob /home/www/myhomepage/error.log
ERROR Failed during configuration: Have not found any log file for apache-nohome jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration

apache-overflows
Unable to switch on the selected jails: f2bmng failed: ERROR No file(s) found for glob /var/log/apache*/*error.log
ERROR No file(s) found for glob /home/www/myhomepage/error.log
ERROR Failed during configuration: Have not found any log file for apache-overflows jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration


..... (not tested)


ssh-iptables
=> started

ssh-iptables-ipset4
Unable to switch on the selected jails: f2bmng failed: WARNING 'actioncheck' not defined in 'Definition'. Using default one: ''
ERROR No file(s) found for glob /var/log/sshd.log
ERROR Failed during configuration: Have not found any log file for ssh-iptables-ipset4 jail
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration

I stopped here.... why is this NOT a bug? That component is not workable with centOS 6.6 and plesk 12.
 
Use plesk-apache-badbot instead.

Plesk shows all existing jails which may be installed from fail2ban package, but this 'default' jails may doesn't work because of server configuration.

In case ERROR No file(s) found for glob /var/www/*/logs/access_log - this means that you have no such files because your virtual hosts are stored in another path.

Additionaly for package default jails, Plesk provides own jails
plesk-apache
plesk-apache-badbot
plesk-courierimap
plesk-horde
plesk-panel
plesk-postfix
plesk-proftpd
plesk-roundcube

which should always work because they are creating with taking in account of server configuration where plesk is installed.
 
Please Stop. Don't mix false facts.

Correct, my start post have a false "logpath". But that your(plesk) mistake, not mine. After re-install fail2ban module, the path is now magical correct. See: http://talk.plesk.com/threads/bug-fail2ban-not-working.332449/#post-777266

I think that my configuration is identical to yours. The right path is for all
/var/www/vhosts/system/*/logs/access_log
not!
/var/www/*/logs/access_log

Your plesk said this too:
logpath = /var/www/vhosts/system/*/logs/*access*log

So why was this path few days ago wrong and you tell me now the mistake is by me? I have nothing change an this filter or my system.
Sorry to said this, but that module is full of misconfiguration. Here a simple proof:

apache-badbots => logpath = /var/log/httpd/*access_log

apache-modsecurity => logpath = /var/log/apache*/*error.log

EDIT: Here another:

ssh-iptables => logpath = /var/log/secure

ssh-iptables-ipset4 => logpath = /var/log/sshd.log

--------------

Thats another general problem of this module: http://talk.plesk.com/threads/questions-to-fail2ban.332445/
As first time user I see not what is the difference between "apache-badbot" and "plesk-apache-badbot". My first thought is, that "plesk-apache-badbot" is ONLY für plesk gui. Why is here not a short description for each filter?

Why there exists two modules that make the same?

[plesk-apache-badbot]
enabled = false
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

[apache-badbots]
enabled = true
filter = apache-badbots
action = iptables-multiport[name=BadBots, port="http,https"]
sendmail-buffered[name=BadBots, lines=5, dest=[EMAIL][email protected][/EMAIL]]
logpath = /var/www/vhosts/system/*/logs/*access_log
/var/log/httpd/*access_log
maxretry = 1
 
Last edited:
Back
Top