Fixing cPanel Apache Fails to Start After ‘upcp’

Issue: On a cPanel powered server, when stopping Apache, and after completing /scripts/upcp – Apache fails to start. A message similar to the following displays in the terminal window:

[email protected] [~]# service httpd start
Redirecting to /bin/systemctl start httpd.service
Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.
[email protected] [~]# journalctl -xe

The Firefox web browser displays a message containing the following:

PR_END_OF_FILE_ERROR

When attempting to restart Apache on the command line, errors similar to the following display:

May 18 16:12:31 server136.ybbv-563.com systemd[1]: Starting Apache web server managed by cPanel EasyApache…
May 18 16:12:32 server136.ybbv-563 restartsrv_httpd[1892]: httpd: Syntax error on line 265 of /etc/apache2/conf/httpd.conf: Syntax error on line 32 of /etc/apache2/conf.d/modsec2.conf: Syntax error on line 29 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
May 18 16:12:32 server136.ybbv-563 systemd[1]: httpd.service: control process exited, code=exited status=1
May 18 16:12:32 server136.ybbv-563 systemd[1]: Failed to start Apache web server managed by cPanel EasyApache.
May 18 16:12:32 server136.ybbv-563 systemd[1]: Unit httpd.service entered failed state.
May 18 16:12:32 server136.ybbv-563 systemd[1]: httpd.service failed.

When running the following command in a terminal:

systemctl status httpd.service

messages are displayed that include references similar to the following:

server136 restartsrv_httpd: httpd: Syntax error on line 265 of /etc/apache2/conf/httpd.conf: Syntax error on line 32 of /etc/apache2/conf.d/modsec2.conf: Syntax error on line 29 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

Solution: Log into WHM and navigate to:

Home >> Security Center >> ModSecurity Vendors

You will likely see that the “COMODO ModSecurity Apache Rule Set” is missing, as suggested in the error message stating: “…/comodo_apache/00_Init_Initialization.conf: No such file or directory…” – Therefore we need to make sure the file is available again.

Reinstall “COMODO ModSecurity Apache Rule Set” by completing the following…

Click the “Add Vendor” button.

Enter the following URL into the “Vendor Configuration URL” field:

https://waf.comodo.com/doc/meta_comodo_apache.yaml

Source: https://help.comodo.com/topic-212-1-670-8350-.html

Click the “Load” button. Doing so will populate the filed for: Vendor Name, Vendor Description, Vendor Documentation URL, Vendor Report URL, and Path.

Click “Save

Within WHM, navigate to:

Home >> Restart Services

and select “HTTP Server (Apache)“.

This will restart Apache, and the restart should be successful because the “…/comodo_apache/00_Init_Initialization.conf” file is now available.

BlogLogistics