For changing the main/primary domain, you will need to have root SSH access and be able to locate and edit the following file (replacing your user & domain info):
/var/cpanel/userdata/USERNAME/DOMAIN.COM
- Once you have opened the file, look for the following line:
documentroot: /home/USERNAME/public_html
- Modify the location according to your needs. Save it and exit.
- Rebuild the Apache conf and restart Apache:
/scripts/rebuildhttpdconf
service httpd restart
The change will be immediate. Simply clear your browser cache and force refresh the page!