How to change the RootDoc for website? not subdomain

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

You can modify the "documentroot" value in the following file:

Code:
/var/cpanel/userdata/username/domain.com
Simply replace "username" with the user name of the account, and "domain.com" with the domain name you would like to edit the document root for. After you have modified the "documentroot" value in this file, you will need to rebuild the Apache configuration file via:

Code:
# /scripts/rebuildhttpdconf
Thank you.
 

AviMoto

Member
Feb 28, 2012
19
0
51
cPanel Access Level
Root Administrator
Thanks a lot,
I see the /etc/httpd/conf/httpd.conf was change but still when I try to load mylandpage.co.il it's go to /public_html and only if I go to mylandpage.co.il/public the application load.

do I need to restart httpd?

And if I want to add <directory > instruction I'll do it in the same file?
 

NixTree

Well-Known Member
Aug 19, 2010
413
5
143
Gods Own Country
cPanel Access Level
Root Administrator
Twitter
Hello,

Yes, you have to restart Apche after rebuilding httpd.conf, to refelct the changes in it. No, don't put any Apche related confs in cpanel/userdata files. You can use the include files specified in the httpd.conf, for the particular domain.

Thank you,
Nibin.
 

AviMoto

Member
Feb 28, 2012
19
0
51
cPanel Access Level
Root Administrator
Thanks a lot,
I see the /etc/httpd/conf/httpd.conf was change but still when I try to load mylandpage.co.il it's go to /public_html and only if I go to mylandpage.co.il/public the application load.

do I need to restart httpd?

And if I want to add <directory > instruction I'll do it in the same file?
The httpd restart was help.

So for now just the question about <directory> instruction
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
The following documentation is useful if you need to make changes within a VirtualHost in the httpd.conf file:

Changes Inside VHost

Thank you.