1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Resolved Fail2ban 504 Gateway Time-out when opening Banned IP Addresses

Discussion in 'Plesk 12.x for Linux' started by Necroman, Jun 8, 2016.

  1. Necroman

    Necroman Basic Pleskian

    4
    20%
    Joined:
    Sep 8, 2015
    Messages:
    25
    Likes Received:
    0
    Hi! I'm having an issue where fail2ban service is running, i can access jails, logs and settings, but i'm having a 504 Gateway Time-out when opening Banned IP Addresses. Also turning on or off jails always gives me an error about time-out and try later to see the changes.

    I have read a lot about fail2ban issues, but i'm unable to solve my problem. I'm using Plesk 12.0.18 Update #85 on CentOS 6 x64 and uninstalled Fail2ban and installed again using Plesk Installer. Its seems to be removed and reinstallled ok but after i Enable intrusion detection, the issues remain. I tried going to Fail2ban logs but there aren't any, and i can't find the log file on my server (/etc/fail2ban/fail2ban.conf has a logtarget = SYSLOG if that helps - i also see a /etc/fail2ban.previous folder).

    I have read somewhere that i may have EPEL or 3rd party repositories that interfered with fail2ban and so i don't have the right version for Plesk, but as i stated i installed fail2ban using Plesk Installer.

    Can someone help? Thanks in advance!
     
    Last edited: Jun 9, 2016
  2. Necroman

    Necroman Basic Pleskian

    4
    20%
    Joined:
    Sep 8, 2015
    Messages:
    25
    Likes Received:
    0
    No one? :(
     
  3. UFHH01

    UFHH01 Plesk addicted!

    44
    64%
    Joined:
    Jun 11, 2013
    Messages:
    6,762
    Likes Received:
    1,712
    Location:
    Hamburg / Germany
    Hi Necroman,

    depending to your server specifications, to the amount of banned IPs, ... it might be a good idea to increase your values for the sw-cp-server ( own webserver only for the Plesk Control Panel ):

    Go to : /etc/sw-cp-server/config

    Pls. make a backup of the existing configuration file, before editing!


    Increase the values for example to:
    Code:
        #keepalive_timeout  0;
        keepalive_timeout  130;
        #tcp_nodelay        on;
    
    ...
    
        fastcgi_max_temp_file_size 0;
        fastcgi_buffers 64 64k;
        fastcgi_buffer_size 128k;
    
        fastcgi_read_timeout 900;
        fastcgi_send_timeout 900;
    
        client_max_body_size 3072m;
    ...


    Pls. read and follow as well:




    Last, pls. consider to READ your error - logs, to be sure, what the cause of your error is:

    /var/log/plesk/sw-cp-server/error_log
    /var/log/plesk/panel.log
    ... and consider as well to change your log - level, to get a better output in your log - files, for investigations:

     
    Necroman likes this.
  4. Necroman

    Necroman Basic Pleskian

    4
    20%
    Joined:
    Sep 8, 2015
    Messages:
    25
    Likes Received:
    0
    Thanks very much! This solved my problem:
    Fail2Ban service gets stuck and IP Address Banning (Fail2Ban) page is not accessible ( KB - article 127495 )

    A newer version of fail2ban was installed using epel repository. However, i would like to see Plesk 12.0 supporting the newest version of fail2ban! This would be great!

    I also like to add that the steps from article 127495 were not enough to solve the problem completely, because after i removed the newer fail2ban, the plesk supported one had the same issues. I noticed problems when activating jails, because before if i activated a jail that couldn't be activated, it immediately informed me, but this wasn't happening. So after removing fail2ban i also had to remove all files and folder from fail2ban and then installed the plesk version via plesk installed. I have much less jails now, but i think they are all working.

    Thanks again!
     
Loading...