Linux : How to change the DocumentRoot of the primary domain of a cPanel account

By | October 2, 2015

This quick procedure will show you how to change the DocumentRoot (usually public_html) to a custom path/folder.

First, make sure the directory exist and that the user have the appropriate read-write permissions.

Then edit the user data file (by replacing the user and domain value to match yours) :

Locate the following statement :

(It should be something like “documentroot: /home/<USER>/public_html/”)

Change it to the new desired path and/or folder name. Example :

Rebuild the Apache configuration :

Restart Apache :