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):
- Edit
/var/cpanel/userdata/USERNAME/DOMAIN.COM
- Change the line
documentroot: /home/USERNAME/public_html
to reflect your needs - Rebuild the Apache config files by executing
/scripts/rebuildhttpdconf
- Restart the Apache service using
service httpd restart