Change the path for root/default website

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
157
168
New Jersey
cPanel Access Level
DataCenter Provider
Yes but keep it in the same cPanel account otherwise you'll have issues, you also need to modify 2 files if the site is running over SSL:

Non SSL:
Code:
/var/cpanel/userdata/$cpuser/$domain
SSL:
Code:
/var/cpanel/userdata/$cpuser/$domain_SSL
You would want to change the line:

Code:
documentroot: /home/$cpuser/public_html
Once you change the path, rebuild apache conf:

Code:
/scripts/rebuildhttpdconf
and finally restart Apache:

Code:
/scripts/restartsrv_apache
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
As an addition to @Jcats suggestion I would also run the following after editing the userdata files:

Code:
/scripts/updateuserdomains
/scripts/updateuserdatacache --force
And before rebuilding the httpd.conf.


Thanks!
 

bearmatt

Registered
Jul 30, 2017
1
0
1
Sydney
cPanel Access Level
Root Administrator
Hi,
I am also struggling to achieve loading a different Default webpage (from same Server/Cpanel account)
Excuse my ignorance, but will the above solution stick after new versions, because I thought that we had to use Include Files ?
Thanks, Matt
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
HI @bearmatt

For this modification changing the userdata files shouldn't be overwritten but it is a customization and it's not supported by cPanel, this just means that while it can be done and many others have done it we don't guarantee it will function as intended forever. This is the only way to achieve what you're looking to do though.

Include files are in the respect you're thinking are more for apache configuration changes directly. Because we pull data for VirtualHosts from the userdata files you are essentially modifying an existing include.

Thanks!