Alter documentRoot public_html to public_html/public

Jun 21, 2016
10
0
1
Brazil
cPanel Access Level
Root Administrator
Hello guys.

I have a little problem, I changed the files:

/var/cpanel/templates/apache2_4/vhost.local in line
DocumentRoot = [% DocumentRoot%]/public

By changing this part and make the following commands:
/Usr/local/cpanel/bin/apache_conf_distiller -update
/Usr/local/cpanel/bin/build_apache_conf
service httpd restart

The server time to time update the files normally:
/var/cpanel/userdata/$username/$domain.com

My problem is that from time to time he takes the documentoroot and concatenate with the public, making a folder loop:

[% DocumentRoot%]/public/public/public .......

How do I change whenever you create a new account the DocumentRoot it is always public_html to public_html/public?

I use various PHP frameworks that need to be in those folders.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
My problem is that from time to time he takes the documentoroot and concatenate with the public, making a folder loop:

[% DocumentRoot%]/public/public/public .......
Hello,

Could you provide some more information on how you want the document root value configured?

Also, could you verify if this happens after cPanel updates? You can test this by forcing an update of cPanel via:

Code:
/scripts/upcp --force
Also, could you let us know if running "/scripts/rebuildhttpdconf" after the update fixes the problem?

Thank you.
 
Jun 21, 2016
10
0
1
Brazil
cPanel Access Level
Root Administrator
Hello,

Could you provide some more information on how you want the document root value configured?

Also, could you verify if this happens after cPanel updates? You can test this by forcing an update of cPanel via:

Code:
/scripts/upcp --force
Also, could you let us know if running "/scripts/rebuildhttpdconf" after the update fixes the problem?

Thank you.
Hello.

Thanks for the answer.

I need to always create a new account, the default Apache way to my client is public_hml/public and not only public_html

I have clients who use several framework and it is necessary that within the public_html folder public is the default.

Can you help me?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Could you verify if this happens after cPanel updates? You can test this by making the changes, and forcing an update of cPanel via:

Code:
/scripts/upcp --force
Also, could you let us know if running "/scripts/rebuildhttpdconf" after the update fixes the problem?

Thank you.
 
Jun 21, 2016
10
0
1
Brazil
cPanel Access Level
Root Administrator
Michael, okay?

Did you understood my question?

I need to change the default apache folder that is currently public_html to public_html / public

Every new account created that that within the public_html folder to be the default public folder apache.

Understood?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Would you mind opening a support ticket using the link in my signature so we can take a closer look and determine why your custom changes are not working as intended? You can post the ticket number here so we can update this thread with the outcome.

Thank you.