
Possibility to change primary or main Domain Document root is 100%. There are two scenarios you will have one you have a cpanel only and second you have a powerful panel provided by your hosting provider. The powerful panel is also called WHM by cpanel if you don’t have a WHM panel so you don’t need to follow this tutorial.
But still you want to change document root so badly just call to your service provider and tell your problem. if you have WHM panel and you want to change your document path just follow the steps.
Step to Change Document Root
1. First of all access your server via SSH as Root Server or WHM terminal both have same process to change Document root. If you want use any ssh client you can download “Putty” software to access server.

2. At this time our main document root is public_html
and our requirement is to change this to public_html/public
. This requirement change be vary as per your requirement.

3. now we write our first command to access our domain configuration file with vim. If you don’t know to use vim don’t worry i will tell you how you can edit and save your file. just try the command is written below by replacing domain.com
to yourdomain name and yourusername
to your current username
vim /var/cpanel/userdata/yourusername/domain.com
4. now change your document path as we changed into current editing file. For enable Editing in vim editor you need to press i
and after press you can see --INSERT--
text at left bottom corner to your terminal after that you can edit your config file.

5. after finish editing you need to save your file. To save file in vim you need to press esc
button then press :
after that you press wq
and press enter
.
6. now same done on SSL file if your site is SSL enabled. If you are not using SSL then you can skip this one.
vim /var/cpanel/userdata/yourusername/domain.com_SSL
7. now change your document path as we changed into current editing file. For enable Editing in vim editor you need to press i
and after press you can see --INSERT--
text at left bottom corner to your terminal after that you can edit your config file.

8. after finish editing you need to save your file. To save file in vim you need to press esc
button then press :
after that you press wq
and press enter
.
9. Now to need to delete cache of main domain or ssl. To do it you need to run two commands.

rm -vf /var/cpanel/userdata/yourusername/domain.com.cache
rm -vf /var/cpanel/userdata/yourusername/domain.com_SSL.cache
10. Now you need to update your userdatacache and build httpd config. To do this again you need to run two more commands
/scripts/updateuserdatacache
/scripts/rebuildhttpdconf
11. Now all set. You just need one more command to restart your server.
service httpd restart
12. Now you can check your cpanel main or primary domain document path is changed.

Conclusion
That all i rest my case 😂. I hope you understand the whole concept to change document root of your primary or main domain whatever you call. If you still getting confused don’t worry i attached a video that you can see live process to change primary domain document path.