Changing default home directory 'public_html'

Ramon Pego

Member
Mar 12, 2019
17
5
3
Brazil
cPanel Access Level
Root Administrator
Hello, I have read some topics here on how to change the root directory of my accounts.
I need it to be just 'public', instead of 'public_html'

I already read a topic that says to change in:
'/var/cpanel/userdata/USERNAME/DOMAIN.COM'
I did but he says after that I need rebuild the:
'/scripts/rebuildhttpdconf'
What do you mean by that?
beacuse did i change, restart apache and updated the browser and still did not change

And I wish everyone would be like this, from now on.

Topic

Thx.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
648
263
Houston
cPanel Access Level
DataCenter Provider
Hello @Ramon Pego


First of all I want to point out that directory customization such as this is not something that cPanel supports. This means if you have issues with this customization our ability to provide assistance may be limited.

To clarify those instructions you'd need to run the following:

change this to what you need it to say:
Code:
documentroot: /home/USERNAME/public_html
Then run the following commands:

Code:
/scripts/updateuserdomains
/scripts/updateuserdatacache
mv /etc/apache2/conf/httpd.conf{,.bk}
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd
You should be able to copy/paste those in order to achieve the desired goal.


Thanks!
 
  • Like
Reactions: Ramon Pego