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

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

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.