How to change Root Folder for primary Domain in Cpanel
If you are having a problem with your root folder for the main domain in Cpanel then this Article for you.
Cpanel/WHM is the most popular Linux based operating system for controlling personal or dedicated hostings. When server admin creating an account with a domain system automatically creating its root folder in system, by following this article you can change your root folder as you want. Please follow the below steps:
Step 1: Log in to your Cpanel and find SSH Access Option, You can create your ssh access details from here.
Step 2: After getting your ssh details, use any ssh client like putty to go inside your system. You can download Putty from here:
Step 3: After login inside your server system by using putty now edit the following command:
# vim /var/cpanel/userdata/USERNAME/MYDOMAIN.COM
Replace USERNAME with your Cpanel ID or Cpanel Account Name
Replace MYDOMAIN.COM with your domain
Step 4: Update Document Root
After editing file, search for Documentroot and change path as per your requirements:
Final Step: Rebuild and restart Apache
After change the configuration, you need to rebuild the apache configuration by restarting the apache server.
# service httpd restart
After Restarting your changes will affect on your hosting.