Plesk 12.x / Linux :: Failed To Start Fail2ban Service
Aug 20, 2014
Code:
Fehler: f2bmng failed: Job for fail2ban.service failed. See 'systemctl status fail2ban.service' and 'journalctl -xn' for details.
ERROR:f2bmng:Failed to start fail2ban service
-- Unit fail2ban.service has failed.
--
-- The result is failed.
Aug 20 14:22:13 noreply.flusiserver.de systemd[1]: Unit fail2ban.service entered failed state.
Aug 20 14:22:14 noreply.flusiserver.de agetty[14140]: /dev/hvc0: No such file or directoryClick to expand...
I installed fail2ban via the autoinstaller today. I got a failed install. There is no /etc/init.d/fail2ban file, and no /usr/bin/fail2ban-server.
On the other hand yum-search tells me it's installed:
plesk-fail2ban-configurator.noarch : plesk-specific jails and filters for fail2ban fail2ban.noarch : Scan logfiles and ban ip addresses with too many password failures​
I tried to remove it in autoinstaller:
Installing packages Loaded plugins: fastestmirror, priorities Running rpm_check_debug Error in PREUN scriptlet in rpm package fail2ban
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 .Click to expand...
I switched off the mail service for one of my domains in that sites control panel a few days ago because there were some malicious files on my server sending out spam. I stopped the service until I cleared all the files that weren't meant to be there and then tried to restart the mail service again but it won't start.
I get this message 'Information: Mail service settings were successfully changed for the selected domains.' but the service stays off. I had the same problem on another site on the same server and carried out the same process but the mail service for that website started fine.
I installed Cloudflare for Plesk during this time and thought that might be causing an issue but after disabling this I still can't start the mail service for the domain.
Is there a section of the main (super admin) control panel that manages the mail services for each domain I am unaware of?
It seems the servers dns will not resolve and has crashed. When starting the "Named" service, here is the error:
Error in named configuration: zone 0.0.127.IN-ADDR.ARPA/IN: loaded serial 20010622 zone 215.170.107.in-addr.arpa/IN: loaded serial 1433121512 zone lanewgirl.com/IN: NS 'ns.mydomain.com' has no address records (A or AAAA)
zone mydomain.com/IN: not loaded due to errors.
_default/mydomain.com/IN: bad zone
zone mydomain2.com/IN: NS 'ns.mydomain2.com' has no address records (A or AAAA)
I upgraded today from 11 to 12, however since the upgrade I am now unable to start the PSA Service, it comes up with the below error.
Starting psa... Starting sw-engine-fpm: Thu Jun 19 13:22:29 2014 (7885): Fatal Error Unable to allocate shared memory segment of 104857600 bytes: mmap: Cannot allocate memory (12)
I have checked resources and everything should be fine, I cant see a reason why it cant allocate the memory, as there is plenty free for it to take from.
I have tried a Bootstrapper repair for 12 however this has not found any issues other than its not able to stop the PSA Service (As its not running)
Everything else is up and running its just the Parallels backend which im guessing is what the PSA Service is!
First, the datacenter lost power so the server shut off. I assume there is some DB corruption and why the SQL Service won't start.
Code: failed Trying to start service mariadb... Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.
WARNING! Some problems are found during start(see log file: /var/log/plesk/psa_service.log)
Continue...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
I ran the systemctl status mariadb.service command and this is below.
For some reason my nginx doenst start and I get the following error:
Error: Unable to start service: Unable to manage service by nginxmng: [2015-05-30 01:03:20] ERR [util_exec] proc_close() failed enabling nginx proxy failed: getsebool: SELinux is disabled
255 Service /etc/init.d/nginx failed to start getsebool: SELinux is disabled
/etc/init.d/sw-cp-server restart Restarting sw-cp-server (via systemctl): Job for sw-cp-server.service failed. See 'systemctl status sw-cp-server.service' and 'journalctl -xn' for details. [FAILED]
tail -f /var/log/sw-cp-server/error_log
2014/11/26 03:06:10 [emerg] 520#0: invalid number of arguments in "fastcgi_buffers" directive in /etc/sw-cp-server/config:31 2014/11/26 03:06:11 [emerg] 874#0: invalid number of arguments in "fastcgi_buffers" directive in /etc/sw-cp-server/config:31
So on our server, fail2ban got itself in a mess. Tried various things to fix, to no avail, so figured I'd just do a fresh install of it. There was minimal customisation to it that I couldn't re-do.
Note I'd already rm'd /etc/fail2ban - as on previous attempts, the files in here didn't appear to be restored to their defaults. So I figured removing the directory would force this to happen (Whether this was wise I'm not sure!) ;-)
So, following instructions here: [URL] .... I now get the following:
# wget http://kb.sp.parallels.com/Attachments/kcs-36245/fail2ban.gz # gunzip fail2ban.gz # mv fail2ban /etc/init.d/fail2ban # chmod 755 /etc/init.d/fail2ban # ll /etc/init.d/fail2ban /etc/fail2ban/fail2ban.conf ls: cannot access /etc/fail2ban/fail2ban.conf: No such file or directory -rwxr-xr-x 1 root root 2141 Aug 15 2014 /etc/init.d/fail2ban
I then uninstall/reinstall with # /usr/local/psa/admin/bin/autoinstaller
(Have tried via the web interface too)
I then get:
# ll /etc/init.d/fail2ban /etc/fail2ban/fail2ban.conf ls: cannot access /etc/fail2ban/fail2ban.conf: No such file or directory -rwxr-xr-x 1 root root 2141 Aug 15 2014 /etc/init.d/fail2ban
i.e., no change..
and if I go to the fail2ban settings in Plesk, I get:
If I go in plesk panel to: Home > Tools & Settings >IP Address Banning > Jails > managing Filters > add filter > type in name & filtercontent and save I get "Information: The jail filter was added". But i can not see the new added filter in the Plesk Filter List (still just the 12 Filters in the list).
On the filesystem > /etc/fail2ban/filter.d/ i can see the new file but with the extension .local - usulay the file is named like xyz.conf
The output of /usr/local/psa/admin/sbin/f2bmng --get-filters-list
Well with activated apache-badbots jails I have in a short time a hugh amount of banned IPs. Usualy action for this is to use iptables-ipset-proto and save all this baned IPs in the ipset insteed as normal in the iptables list - thats also a suggestion which was discussed in the fail2ban forum for better performance. And yes I had this running (ipset package installed) with my manual installation of fail2ban before I switched over to the plesk integrated.
action = iptables-ipset-proto6[name=BadBots, port="http,https,7080,7081"] insteed of action = iptables-multiport[name=BadBots, port="http,https,7080,7081"]
So how can I add iptables-ipset-proto4.conf, iptables-ipset-proto6-allports.conf, iptables-ipset-proto6.conf to the plesk version of fail2ban??
I have the problem that the ip blocked "failban" too short (set findtime=1800).
The ip should be blocked for 30 minutes (the second time).
2015-03-23 22:24:59,779 fail2ban.filter [2807]: INFO Set maxRetry = 5 2015-03-23 22:24:59,780 fail2ban.filter [2807]: INFO Set findtime = 1800 2015-03-23 22:24:59,781 fail2ban.actions[2807]: INFO Set banTime = 600
I would find an easy way to add a list of IP in Fail2ban whitelist in linux console.What is the file to modify ? Is there a command line or a process ?
12.0.18 Update #46, last updated at May 15, 2015 03:57 AM
Just recently (after update #46) Fail2Ban stopped working and I couldn't restart it or pin point the reason behind it. I decided to uninstall F2B component via Plesk installer.
F2B uninstalled however when I try to install it again I get error : 'Installation will not continue'
Where to start and where can I find log files that could give me some clues?
After changing website domain name (from development one -dev-domain.com- to production one) we have this error in fail2ban.log :
2015-02-01 06:46:41,176 fail2ban.filter [2848]: ERROR Unable to open /var/www/vhosts/system/dev-domain.com/logs/proxy_access_log 2015-02-01 06:46:41,176 fail2ban.filter [2848]: ERROR [Errno 2] No such file or directory: '/var/www/vhosts/system/dev-domain.com/logs/proxy_access_log' Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/server/filter.py", line 520, in getFailures has_content = container.open() File "/usr/lib/python2.7/dist-packages/server/filter.py", line 601, in open self.__handler = open(self.__filename) IOError: [Errno 2] No such file or directory: '/var/www/vhosts/system/dev-domain.com/logs/proxy_access_log'
I have just looked at the plesk panel log - /usr/local/psa/admin/logs/panel.log - and seen an alarming number of attempts to access plesk using the admin user. i.e.
[2015-02-02 14:53:46] ERR [panel] [Action Log] Failed login attempt with login 'admin' from IP 50.62.148.176
I have fail2ban installed and set up for other things...
i'm running 12.0.18#34 on PCS dedicated server. i recently discovered that some of the default jails on fail2ban that is shipped with Plesk 12 were not working correctly. Let me explain what i mean. For instance, the plesk-panel jail. The logs were parsed correctly, the command was successfully appended in iptables list, the fail2ban log was updated. Still, the intruder was not blocked. I kept reading "already banned" on the fail2ban.log but actually there was no blocking.
After some checks, i found out that fail2ban default configuration states SSH as default blocking port. that means, the block was working but only for ssh hits. thus the plesk-panel admin page hits were passing through.
since i added port=http,https on jail.local > plesk-panel and did it a restart on fail2ban service, only then did it start to actually block incoming hits.
I think this should be verified by programmers group and maybe include a fix in some future minor update.
I have updated from 11.5 to 12.0 mostly in order to use Fail2Ban.
I have also installed a new Plesk 12 license key to make sure that the license allows Fail2Ban. It says now that Fail2Ban is "On". But I can not find the menu entry to get to the Fail2Ban configuration. It is simply not there... (it is supposed to be in the Securitiy menu in the Tools and Settings section...)