Question
How can I regenerate the file /var/cpanel/modsec_cpanel_conf_datastore?
Answer
This file is not always updated properly when rule changes occur. 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 along with its cache aside and then running the modsec_cpanel_conf_init script.
mv /var/cpanel/modsec_cpanel_conf_datastore{,.$( date +%Y%m%d )}
mv /var/cpanel/modsec_cpanel_conf_datastore.cache{,.$( date +%Y%m%d )}
/usr/local/cpanel/bin/modsec_cpanel_conf_init