Symptoms
During an upcp update, an error occurs when mod_security rules are removed but are still configured as existing. The error will look something like this (note that the vendor name could be different; in this case, the vendor name is comodo_litespeed):
The system could not restore the original configuration: The system could not validate the new Apache configuration because httpd exited with a nonzero value. Apache produced the following error: httpd_ls_bak: Syntax error on line 274 of /etc/apache2/conf/httpd.conf: Syntax error on line 32 of /etc/apache2/conf.d/modsec2.conf: Syntax error on line 28 of /etc/apache2/conf.d/modsec/modsec2.cpanel.conf: Could not open configuration file /etc/apache2/conf.d/modsec_vendor_configs/comodo_litespeed/00_Init_Initialization.conf: No such file or directory
Workaround
The first thing to do here is to log into WHM and go to "ModSecurity™ Vendors" and note the current vendor(s) and rules enabled.
Then these two files need to be moved:
mv -v /var/cpanel/modsec_cpanel_conf_datastore{,.original_backup}
mv -v /var/cpanel/modsec_cpanel_conf_datastore.cache{,.original_backup}
Next, go back to WHM and enable the vendor(s) and rules again under "ModSecurity™ Vendors".