If you make changes to the configuration file directly for the VirtualHost section of /usr/local/apache/conf/httpd.conf file, those changes will not stay given it says this at the top of each entry:
# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
If you modify the template file directly as /var/cpanel/templates/apache2/vhost.default, this will also be overwritten. To modify the /var/cpanel/templates/apache2/vhost.default file, that must be copied to /var/cpanel/templates/apache2/vhost.local and then vhost.local file edited instead to retain the changes.
Your options would be to either use the include files placed into /usr/local/apache/conf/userdata/ location or by editing the entries at /var/cpanel/userdata/username/domain.com location (where
username is the cPanel username and
domain.com is the domain name).
For details on adding include files at /usr/local/apache/conf/userdata location, please view the following documentation:
Changes Contained within a VirtualHost Directive