The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing DocumentRoot of all sites

Discussion in 'General Discussion' started by Thiago Moreira, Jun 22, 2016.

  1. Thiago Moreira

    Joined:
    Jun 21, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Changing DocumentRoot of all sites and leave as default DocumentRoot below:

    /public_html

    to

    /public_html/www

    www is DocumentRoot of all sites.

    My apache server is 2.4, tutorials here forums cpanel not working.
     
    #1 Thiago Moreira, Jun 22, 2016
    Last edited by a moderator: Jun 22, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You can modify the document root for a domain name by editing the "documentroot" entry in the appropriate cPanel user data file:

    Code:
    /var/cpanel/userdata/$username/$domain.com
    Then, rebuild the Apache configuration file via:

    Code:
    /scripts/rebuildhttpdconf
    You will need to develop a script that completes this action for all accounts, and runs automatically when new accounts are created, if you prefer to automate this functionality.

    Thank you.
     
  3. Thiago Moreira

    Joined:
    Jun 21, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    I believe you do not understand, let's go.

    In my hosting use mainly laravel, and would leave already configured that each account created apache make reading the DocumentRoot in public_html/www

    Would it automatically, every account created a template for this was generated.

    I have changed the /root/ cpanel3-skel/public_html to automatically create the www folder and with the necessary access, could understand?

    Thank you very much.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. Thiago Moreira

    Joined:
    Jun 21, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. hrace009

    hrace009 Well-Known Member

    Joined:
    Dec 24, 2013
    Messages:
    66
    Likes Received:
    8
    Trophy Points:
    8
    Location:
    Root
    cPanel Access Level:
    Root Administrator
    Twitter:
    why don't build it default from cPanel installation, so we don't need more costumize...
    sigh....
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello @hrace009,

    We do have a feature request opened to allow users to update the document root for the primary domain name associated with the account through cPanel:

    Allow users to change the DocumentRoot

    I encourage you to open a new feature request if you'd like to see the ability for administrators to change the default document root for new accounts via an option in Web Host Manager:

    Submit A Feature Request

    Thank you.
     
Loading...

Share This Page