Symptoms
Apache fails to start with an error similar to the following.
httpd: Syntax error on line 282 of /etc/apache2/conf/httpd.conf.work.5e4931c4.cfgcheck: Syntax error on line 33 of /etc/apache2/conf.d/modsec2.conf: Syntax error on line 27 of /etc/apache2/conf.d/modsec/modsec2.cpanel.conf: Could not open configuration file /etc/apache2/conf.d/modsec_vendor_configs/comodo_apache/00_Init_Initialization.conf: No such file or directory
Description
ModSecurity is enabled by default. When Apache starts, it will verify that the ModSecurity configuration file and all include files are loaded and validate their contents. The error will occur when one or more include files are missing.
Workaround
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Open the modsec2 configuration file shown in the error message (either
modsec2.user.conformodsec2.cpanel.conf) in your preferred text editor. - Locate the
Includeline for the missing.conffile stated in the error message. - Comment out the line.
#Include /etc/apache2/conf.d/modsec_vendor_configs/comodo_apache/00_Init_Initialization.conf
- Comment out any other
Includelines for.conffiles that are missing or should not be processed. - Save the changes and exit the text editor.
- Rebuild the Apache configuration.
/usr/local/cpanel/scripts/rebuildhttpdconf
- Verify that there are no errors.
- Restart the web server service.
/usr/local/cpanel/scripts/restartsrv_httpd
Comments
0 comments
Article is closed for comments.