Scroll
Netmow
Shape

Start a project

Blogs/Cpanel

How to change Root Folder for primary Domain in Cpanel

Root Folder for primary Domain
Icon
Published on: 20 December, 2019

If you are having a problem with your root folder for the primary domain in Cpanel then this Article is for you.

Cpanel/WHM is the most popular Linux based operating system for controlling personal or dedicated hostings. When the server admin creates an account with a domain system automatically creates its root folder in the 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.

root_folder_change_by_SSH

Step 2: After getting your ssh details, use any ssh client like putty to go inside your system. You can download Putty from here:

DOWNLOAD PUTTY

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 the file, search for Documentroot and change the path as per your requirements:

documentroot: /home/USERNAME/public_html/NEW_PATH

Final Step: Rebuild and restart Apache
After changing the configuration, you need to rebuild the apache configuration by restarting the apache server.

# /scripts/rebuildhttpdconf
# service httpd restart

After Restarting your changes will affect your hosting.

Quote
START A PROJECT
Quote

If you are stuck or anything, you hire us for an expert hand. Book an appointment with us or call at 477937937.

Restore a WordPress website by using Duplicator Plugin

Was this article helpful?
YesNo