Symptoms
-
The following error is displayed in Plesk:
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
-
Connect to the server via SSH.
-
Back up the Custom Directives configuration file from ModSecurity:
# cp -a /etc/httpd/conf/plesk.conf.d/modsecurity.conf /root/modsecurity.conf.backup
-
Empty the Custom Directives configuration file from ModSecurity:
# echo "" > /etc/httpd/conf/plesk.conf.d/modsecurity.conf
-
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