Support » Plugin: NinjaFirewall (WP Edition) - Advanced Security » NinjaFirewall Fail2Ban on Plesk

  • Resolved Giulio Alfonso


    This is a workaround to combine NinjaFirewall with Fail2Ban on Plesk Onyx.

    First: If you don’t have, install fail2ban. # plesk installer –select-release-current –install-component fail2ban

    Second: Go to /etc/fail2ban/filter.d/ and create a new file: ninjafirewall.conf

    Copy this to the file:

    before = common.conf

    _daemon = ninjafirewall

    failregex = .* \[YOURDOMAIN]\ \[.*]\ \[0]\ \[1]\ \[<HOST>]\.*
    ignoreregex =

    Third: Copy this to your jail.local file:

    enabled = true
    filter = ninjafirewall
    action = iptables-allports[name=ninjafirewall]
    logpath = /var/www/vhosts/YOURDOMAIN/httpdocs/wp-content/nfwlog/firewall_*-*.php
    findtime = 31536000
    bantime = 31536000
    maxretry = 1

    Replace: YOURDOMAIN in the new added content with your domain eg. or, as you are using it. Take look at your paths if you are not sure how you have set it.

    Last: restart fail2ban: service fail2ban restart

    If fail2ban won’t start, make sure you have set YOURDOMAIN correct.

    Thats all, you are done.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.