Changing Primary Domain Document Root in Cpanel

  1. Login to ssh.
  2. sudo and edit this file:

    If you have SSL:


    user is your cpanel username and domain is your domain, _SSL capital leter.

  3. Change these 2 line to your new document root:
    documentroot: /home/USER/public_html


    path: /home/USER/public_html/cgi-bin
  4. Run sudo:
    sudo /scripts/rebuildhttpdconf
    sudo service httpd restart
  5. Done.