Symptoms
-
RHEL/CentOS/CloudLinux is used on a server with Plesk.
-
The following error is shown in Plesk UI:
New configuration files for the Apache web server were not created due to the errors in configuration templates: httpd_ls_bak: 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 66 of /etc/httpd/conf/plesk.conf.d/server.conf: Syntax error on line 1 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
Cause
Syntax error in Apache configuration file. Reference to the file 00_mod_security.conf
is missing.
Resolution
-
Connect to the server via SSH as root user.
-
Create the backup of Apache configuration file:
# cp -a /etc/httpd/conf/plesk.conf.d/modsecurity.conf{,.bak}
-
Add the path containing
00_mod_security.conf
in configuration file/etc/httpd/conf/plesk.conf.d/modsecurity.conf
in the following way, for example:# cat /etc/httpd/conf/plesk.conf.d/modsecurity.conf
Include "/etc/httpd/conf.d/00_mod_security.conf" -
Check the configuration of Apache web server:
# httpd -t
Syntax OK -
Rebuild web server configuration files:
# plesk repair web