Plesk

Unable to activate or change the ModSecurity ruleset in Plesk: /etc/httpd/conf.d/modsec2.imunify.conf No such file or directory

Symptoms

Cause

Imunify360 extension was removed and there are leftovers in the ModSecurity additional configuration.

Resolution

  1. Connect to the server via SSH.

  2. Back up the Custom Directives configuration file from ModSecurity:

    # cp -a /etc/httpd/conf/plesk.conf.d/modsecurity.conf /root/modsecurity.conf.backup

  3. Empty the Custom Directives configuration file from ModSecurity:

    # echo "" > /etc/httpd/conf/plesk.conf.d/modsecurity.conf

  4. Log in to Plesk.

  5. Go to Tools & Settings > Web Application Firewall (ModSecurity) and enable it with the necessary ModSecurity ruleset

    Note: In case it's necessary to use Imunify360 extension, uninstall and reinstall the extension back on the system

Exit mobile version