Changing Primary Domain Document Root in Cpanel

Standard
  1. Login to ssh.
  2. sudo and edit this file:
    /var/cpanel/userdata/user/domain

    If you have SSL:

    /var/cpanel/userdata/user/domain_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

    and

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