Change The Document Root Location of a Domain on Cpanel

By default a cpanel account will have it’s domain point to /home/username/public_html but if you want to change it to point to a separate folder, you would just need to ssh in to the server and edit these files:

vim /var/cpanel/userdata/USERNAME/
vim /var/cpanel/userdata/USERNAME/domain.com_SSL

So just replace USERNAME with the cpanel username and with the actual domain. But in those files you would change:

documentroot: /home/username/public_html
documentroot: /home/username/public_html/some/other/folder

Save that, then first make a backup of the main apache configuration file:

cp -rp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak

Then have the system rebuild apache’s configuration:


Then finally restart apache:

service httpd restart

Then the domain should start resolving to the new documentroot path after that.