• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Fail2ban not working on almalinux

zodi

New Pleskian
I just installed plesk on almalinux and fail2ban not started.
I reinstalled fail2ban via plesk, but it still doesn't work.

Is there any solution to this?
 
systemctl status fail2ban.service
Code:
 fail2ban.service - Fail2Ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/fail2ban.service.d
           └─50-ensure-log.conf
   Active: failed (Result: exit-code) since Sat 2021-07-31 20:46:07 EEST; 20min ago
     Docs: man:fail2ban(1)
  Process: 75103 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255)
  Process: 75099 ExecStartPre=/bin/sh -c umask 077; touch /var/log/fail2ban.log; restorecon /var/log/fail2ban.log >/dev/null 2>
  Process: 75097 ExecStartPre=/bin/mkdir -p /run/fail2ban (code=exited, status=0/SUCCESS)
 Main PID: 75103 (code=exited, status=255)

Jul 31 20:46:07  systemd[1]: Starting Fail2Ban Service...
Jul 31 20:46:07  systemd[1]: Started Fail2Ban Service.
Jul 31 20:46:07  fail2ban-server[75103]: 2021-07-31 20:46:07,939 fail2ban        >
Jul 31 20:46:07  fail2ban-server[75103]: 2021-07-31 20:46:07,942 fail2ban        >
Jul 31 20:46:07  systemd[1]: fail2ban.service: Main process exited, code=exited, >
Jul 31 20:46:07  systemd[1]: fail2ban.service: Failed with result 'exit-code'.
 
Try to look into /var/log/fail2ban.log to see the details why it is failing to start.
 
systemctl start fail2ban.service
systemctl enable fail2ban.service

after

systemctl status fail2ban.service

status active: failed

fail2ban.service - Fail2Ban Service
Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/fail2ban.service.d
└─50-ensure-log.conf
Active: failed (Result: exit-code) since Mon 2021-11-15 07:16:03 CET; 1min 31s ago
Docs: man:fail2ban(1)
Main PID: 3386 (code=exited, status=255)

nov 15 07:16:03 cloud.spaziohost.com systemd[1]: Starting Fail2Ban Service...
nov 15 07:16:03 cloud.spaziohost.com systemd[1]: Started Fail2Ban Service.
nov 15 07:16:03 cloud.spaziohost.com fail2ban-server[3386]: 2021-11-15 07:16:03,203 fail2ban [3386]: ERROR Failed during configuration: Have not found any lo>
nov 15 07:16:03 cloud.spaziohost.com fail2ban-server[3386]: 2021-11-15 07:16:03,204 fail2ban [3386]: ERROR Async configuration of server failed
nov 15 07:16:03 cloud.spaziohost.com systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/n/a
nov 15 07:16:03 cloud.spaziohost.com systemd[1]: fail2ban.service: Failed with result 'exit-code'.
 
Code:
ERROR Failed during configuration: Have not found any lo>
Where is the continuation of this line of the log? It should be like:
Code:
ERROR Failed during configuration: Have not found any log file for plesk-horde jail
for example. In this case create the missing logfiles manually and assign required ownership for them:
Code:
# touch /var/log/maillog
# mkdir /var/log/psa-horde
# touch /var/log/psa-horde/psa-horde.log
# chown horde_sysuser:horde_sysgroup /var/log/psa-horde/psa-horde.log
 
If I remember correctly one other thing that you have to watch is that a minimal install of AlmaLinux and Plesk doesn't actually install rsyslog so your logs (/var/log/messages, /var/log/maillog, /var/log/secure) are always empty. You have to install it manually so that fail2ban can track things properly:

Code:
yum install rsyslog
systemctl enable rsyslog --now
 
If I remember correctly one other thing that you have to watch is that a minimal install of AlmaLinux and Plesk doesn't actually install rsyslog so your logs (/var/log/messages, /var/log/maillog, /var/log/secure) are always empty. You have to install it manually so that fail2ban can track things properly:

yum install rsyslog
systemctl enable rsyslog --now

dnf install rsyslog -y
systemctl abilita rsyslog --now

Thank you perfect it worked.

So when do you install Almalinux, what kind of installation do you need to do?
 
The minimal install that you did was correct. This is really a Plesk bug as it should be making sure that a proper logger is installed when you install Plesk.
 
This is really a Plesk bug as it should be making sure that a proper logger is installed when you install Plesk.
 
Back
Top