Question
How can I regenerate the file /var/cpanel/modsec_cpanel_conf_datastore?
Answer
This file is not always updated properly when rule filenames/locations change. That can lead to errors when rebuilding the Apache configuration (an Apache rebuild occurs during the installation of the ModSecurity ruleset). This can be addressed by moving the above file and cache aside and then running the modsec_cpanel_conf_init script.
mv /var/cpanel/modsec_cpanel_conf_datastore{,.bak}
mv /var/cpanel/modsec_cpanel_conf_datastore.cache{,.bak}
/usr/local/cpanel/bin/modsec_cpanel_conf_init