Is there way to change the DocumentRoot of an account using cPanel, either during account creation or later on?
Or is there some other way to have two cPanel accounts share a DocumentRoot?
If you have root access to the server, you can try this.
Service Configuration --> Apache Setup --> Include Editor --> Pre Virtual Host Include
Paste these codes there and restart your apache, that would do
# This is self created
<VirtualHost ipaddress:80>
ServerName domain.com
ServerAlias
www.domain.com
ServerAdmin
[email protected]
DocumentRoot /home/changetheusername/public_html
</VirtualHost>
Note that you should put this in Pre Virtual Host, apache reads top down, if you put it in Post, apache will read the automatic generated codes.
You might want to check your /etc/httpd/conf/httpd.conf for example of automatic generated virtualhost, copy them and amend servername, serveralias and documentroot.
Hope this helps.