Articles in this section

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

Plesk for Linux kb: technical ext: Imunify

Applicable to:

  • Plesk for Linux

Symptoms

  • The following error is displayed in Plesk:

    PLESK_ERROR: httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 5 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Syntax error on line 62 of /etc/httpd/conf/plesk.conf.d/server.conf: Syntax error on line 2 of /etc/httpd/conf/plesk.conf.d/modsecurity.conf: Could not open configuration file /etc/httpd/conf.d/modsec2.imunify.conf: No such file or directory

  • The file /etc/httpd/conf.d/modsec2.imunify.conf doesn't exist:

    # ls -lha "/etc/httpd/conf.d/modsec2.imunify.conf"
    ls: cannot access /etc/httpd/conf.d/modsec2.imunify.conf: No such file or directory

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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.