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.

Adjusting web root location

Discussion in 'General Discussion' started by Lighty_46, Apr 8, 2014.

  1. Lighty_46

    Lighty_46 Registered

    Joined:
    Apr 8, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi,

    I've just added an Addon domain through cPanel, and was wondering how I would go about adjusting the current folder layout from the following:

    public_html (currently the primarydomain.com web root)
    > secondarydomain.com

    to this:

    public_html
    > primarydomain.com
    > secondarydomain.com

    I've had a look through the cPanel, but cant find anything that would allow me to do this, but I might just be missing something. I can obviously create the folders and add the files through FTP, but I don't know how to change the primary domain's web root.

    Any help is appreciated,
    Thanks! :)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    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
    Thank you.
     
  3. Breuddwydion

    Breuddwydion Registered

    Joined:
    Sep 4, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Iowa
    cPanel Access Level:
    Root Administrator
    Is this still the best way to modify the domain roots, or is there a cPanel / WHM -only way to do this? Now that cPanel has evolved for a couple of years, I'd prefer not to do something that might "confuse" the GUI going forward if this is available via the GUI.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    You should follow the instructions on the document below when making this change with EasyApache 4:

    Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation

    Setup a custom include file for the domain name and define a custom DocumentRoot value.

    Let us know if you have any questions.

    Thank you.
     
Loading...

Share This Page