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.

File structures in addon domains

Discussion in 'Bind / DNS / Nameserver Issues' started by Rezelute, Sep 4, 2015.

  1. Rezelute

    Rezelute Registered

    Joined:
    Sep 4, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Website Owner
    Hi,
    I am still fairly new to cPanel so excuse my stupid question (I have done alot of searching on google and this forum but cant really find my exact answer). From what i understand, public_html is the root directory of my main domain website which could contain the following for example: public_html/wp-admin, public_html/wp-content, public_html/wp-inc etc.

    If I wanted to create an addon domain, I might setup the following: public_html/MyAddonSite.co.uk/ and then I point the addon to the newly purchased domain (MyAddonSite.co.uk). My issue with this is that the main website would look slightly cluttered with folders of the main domain and then the addon domains as such:
    public_html/wp-admin, public_html/wp-content, public_html/wp-inc, public_html/MyAddonSite.co.uk.

    Is this the only way of setting up multiple websites on one host? Might it be possible for example to either have MyAddonSite.co.uk outside the public_html directory or have two seperate websites in the public_html as such: public_html/MainWebsite.co.uk, public_html/MyAddonSite.co.uk.

    Thank you for the clarification!
     
    #1 Rezelute, Sep 4, 2015
    Last edited by a moderator: Sep 4, 2015
  2. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi,

    I tend to setup my addon domains in /home/{username}/addon-domains.

    The folder doesn't exist but you can create it and then have a folder for each domain. That way, it's out of your public_html and out of public view unless they access that domain directly.

    Hopes this helps.
     
  3. Rezelute

    Rezelute Registered

    Joined:
    Sep 4, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Website Owner
    Thanks for the reply, how do you then make the main domain point to a specific folder? So if "www.test.co.uk" is my main domain, how do i make the "/home/username/www.test.co.uk/" the root directory of the website?
     
  4. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    Your main domain will always be /home/{username}/public_html/. This can't be changed. However, addon domains and sub domains can be placed anywhere inside your home directory.

    If you have another domain, for example test.com with test.co.uk as your main domain, you could either setup test.com as an addon domain which allows you to specify the root folder or as a parked domain which, if parked on test.co.uk will mirror public_html.
     
    #4 LostNerd, Sep 5, 2015
    Last edited: Sep 5, 2015
  5. Rezelute

    Rezelute Registered

    Joined:
    Sep 4, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Website Owner
    Ah ok perfect so just to confirm then, the following structure would be fine as a practise?
    /home/{username}/public_html/wp-admin + public_html + wp-content + wp-inc etc.
    And then the addon domain could be pointing to:
    /home/{username}/test.com
     
    #5 Rezelute, Sep 5, 2015
    Last edited by a moderator: Sep 5, 2015
  6. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    Okay so...

    test.co.uk - Main Domain
    Root: /home/{username}/public_html/

    Any folders placed in here are accessible via test.co.uk/{folder-or-file}

    test.com - Addon Domain
    Root: Anywhere you like, I personally prefer /home/{username}/addon-domains/

    As long as the addon domain root folder is NOT in /home/{username}/public_html/, it is not in anyway accessible via your browser on test.co.uk. Only on .com.

    Your theory is in practice, correct.
     
    Rezelute likes this.
  7. Rezelute

    Rezelute Registered

    Joined:
    Sep 4, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Website Owner
    Thank you for confirming that, appreciate it!
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,807
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  9. LostNerd

    LostNerd Well-Known Member

    Joined:
    Mar 12, 2014
    Messages:
    258
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Hastings, East Sussex, UK
    cPanel Access Level:
    Root Administrator
    Twitter:
    Due to his access level being set as Website Owner, I didn't feel it necessary to let our friend know about this as he would need to be an administrator to make this change, correct?
     
    Infopro likes this.
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,807
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, that is correct. Root access is required to change the document root of the domain name associated with the cPanel account.

    Thank you.
     
Loading...

Share This Page