on cPanel by default the main domain name has public_html for the root directory, but can it be changed?
Sure, here is a guide on how to change root directory from public_html for the main domain in cPanel.
Edit the following files:
/var/cpanel/userdata/USERNAME/DOMAIN.COM
under documentroot set path to the new directory and save changes:
If your website uses SSL (and who doesn’t ) do the same for the following file:
/var/cpanel/userdata/USERNAME/DOMAIN.COM_SSL
Save the file after changes are made and then delete the cache file for your primary domain.
rm -vf /var/cpanel/userdata/USERNAME/DOMAIN.COM_SSL.cache
Run the following scripts to update any user data cache and rebuild apache configuration file
/scripts/updateuserdatacache
/scripts/rebuildhttpdconf
and finally restart Apache server to load changes.
service httpd restart