Change cPanel Document Root

Recently I needed to change the document root (viz. the public_html folder) of a specific account on a WHM/cPanel server. Here’s how (root access required):

  1. Edit /var/cpanel/userdata/USERNAME/DOMAIN.COM
  2. Change the line documentroot: /home/USERNAME/public_html to reflect your needs
  3. Rebuild the Apache config files by executing /scripts/rebuildhttpdconf
  4. Restart the Apache service using service httpd restart

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.