Tyrsson

Registered
Apr 19, 2022
2
0
0
Birmingham
cPanel Access Level
Root Administrator
Im sure this is a duplicate and I apologize but every thing I have found is years old. Can someone please provide a link to the most recent recommended procedure for changing the doc root. Im comfortable with terminal etc. I'm a Php developer that develops primarily in Laminas framework and would change the doc root of the default apache site (the one for my domain, only account on the server) to /public instead of /public_html, especially since zero frameworks that I know of builds from the /public_html directory. I would also like to set the server to provision all future host with a /public docroot instead of the current /public_html. Its been around 8-9 years since I have used whm/cpanel so its changed a lot since then. Any information would be greatly appreciated.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Hey there! Here's an article on how to change the docroot for existing accounts:


I'm not finding a way to change the default document root for newly created accounts, as even the creatacct API call doesn't have such an option. Instead of manually changing the document root, would a symlink inside /home/username work?