• 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

Fail2ban won't set jail on plesk-apache: permissions error

Hiljo_Lodewijk

New Pleskian
Hello everyone,

Compliments about the integration of Fail2Ban. I saw a lot of blocks on different IP addresses that tried to logon to the server. Fail2Ban is setup to monitor SSH, FTP, and some more.

It is however not possible to activate the "plesk-apache" and "plesk-apache-badbot" jails.

I receive the following error when I try to activate the jails:
Cannot activate the selected jails: f2bmng failed: ERROR NOK: ('plesk-apache',)
ERROR NOK: (13, 'Permission denied')
ERROR NOK: (13, 'Permission denied')
......
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload', 'plesk-apache']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration: plesk-apache


When i look into the logfile of fail2ban, i see that there are no permissions for the log files:
2015-01-10 20:14:40,987 fail2ban.comm [19428]: WARNING Command ['set', 'plesk-apache', 'addlogpath', '/var/www/vhosts/system/[domainname]/logs/error_log'] has failed. Received IOError(13, 'Permission denied')

The file permissions are set as following on all the log files:
-rw-r--r-- root root

Please let me know how to solve this. I'd really like to activate Fail2Ban for Apache too.
 
Hi Hiljo_Lodewijk,

the permissions for a domain specific "error_log" should be:

-rwx--x--- 2 DOMAIN_SPECIFIC_SYSTEM_USER psaserv


You could use the command:

/usr/local/psa/bin/repair --restore-vhosts-permissions

... to restore your permissions.
 
Hi Hiljo_Lodewijk,

there are several possible reasons, starting by bugs, over to misconfigurations and as well temporary issues. To investigate your case, I would recommend to inspect the Plesk - Control - Panel - log ( maybe debug mode is required to have a more detailed output there ).
 
Could you give me a hint in the right direction? The logs of Plesk are almost empty, and do not give any information about this specific issue..
 
Back
Top