NETMOW

logo

How to change Root Folder for primary Domain in Cpanel

How to change Root Folder for primary Domain in Cpanel

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.

Request a Free Audit

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

Related articles

A web hosting service is a type of internet hosting service that allows personal and organizations to create their website...

Cpanel 27 January, 2021

We know that the Duplicator WordPress plugin is for backing up your WordPress sites, but where it really excels is...

Cpanel 20 November, 2020

Web designing is an art. We have to choose perfect and different structures for every site. It is different for...

Cpanel 19 November, 2020

Let’s Grow Your Business

We are idea generators, goal seekers, challenge-thirsty professionals,
creators of unique Digital projects.