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.

Default directory layout for domains/accounts

Discussion in 'General Discussion' started by ploaiza, Nov 29, 2012.

  1. ploaiza

    ploaiza Registered

    Joined:
    Nov 29, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Right now when I create a new account the system generates a /home/{accountName}/public_html and associated folders.

    Is there a way I can have the system create /home/{accountName}/{initialDomain}/www/public_html instead?

    And as a followup any new domains created under that account, have it create /home/{accountName}/{newdomain}/www/public_html.

    What got me started on all this is that I'd much rather have subdomains as /home/{accountName}/{domainName}/{subdomain}/public_html than the way the system creates them now.

    This would provide a consistent folder system for primary and sub domains, much easier to work with (at least for my purposes).

    I've looked through the docs and did a cursory google search but could not find any relavant info (other than adding a sym link from where the system puts public_html to where I want it to put it).
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Where would an addon domain be placed in that scenario?
     
  3. ploaiza

    ploaiza Registered

    Joined:
    Nov 29, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    /home/{accountName}/{addOnDomain}/www/public_html

    and then, logically, within the add on domain

    /home/{accountName}/{addOnDomain}/{subdomain1}/public_html
    /home/{accountName}/{addOnDomain}/{subdomain2}/public_html
    /home/{accountName}/{addOnDomain}/{subdomain3}/public_html

    or something along the lines of:

    /home/{accountName}/domains/{domainName1}/www/public_html
    /home/{accountName}/domains/{domainName1}/{subdomain1}/public_html
    /home/{accountName}/domains/{domainName1}/{subdomain2}/public_html

    /home/{accountName}/domains/{domainName2}/www/public_html
    /home/{accountName}/domains/{domainName2}/{subdomain1}/public_html
    /home/{accountName}/domains/{domainName2}/{subdomain2}/public_html


    or anything that gets me to a consistent global folder structure for domains and subdomains
     
    #3 ploaiza, Nov 29, 2012
    Last edited: Nov 29, 2012
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    What if I wanted to create a sub.domain outside the public_html directory? An option we have with cPanel.

    Also, whats the www for in your path? In your cPanel account this is not a directory.

    I'm just trying to wrap my brain around what you're looking for thats not currently available.
     
  5. ploaiza

    ploaiza Registered

    Joined:
    Nov 29, 2012
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    In the system I want, ALL of the subdomains are outside the public_html directory. I pretty much never want them in the standard public_html folder.

    The www is the default (no subdomain) "website".

    I want a consistent folder structure for all domains and subdomains and I want cPanel to create this structure by default when I create an account or domain or subdomain.

    If I go into cPanel right now and add a new domain it first defaults to putting it under public_html. I never want that.

    So I override it and have it put it under document root

    So now I have the original account/domain public_html

    /home/{accountName}/public_html

    and the new domain

    /home/{accountName}/{newDomain}

    This is not a consistent naming system.

    A more consistent system would be:

    /home/{accountName}/{domain}/public_html

    If I didn't care about sub domains.

    But I DO care about subdomains and I almost never want them to be in the public_html folder

    So I end up with:

    /home/{accountName}/public_html
    /home/{accountName}/{fistDomain subdomains}/{subdomain1}
    /home/{accountName}/{fistDomain subdomains}/{subdomain2}
    /home/{accountName}/{secondDomain subdomains}/{secondDomain subdomain1}
    /home/{accountName}/{secondDomain subdomains}/{secondDomain subdomain2}

    or some other bastardization. This is NOT what I want.

    What I want is a consistent folder structure:

    /home/account/domain1/www/public_html (which would be /home/account/public_html in the default cPanel setup)
    /home/account/domain1/subdomain1/public_html
    /home/account/domain2/www/public_html (which would be /home/account/domain2 in the current system)
    /home/account/domain2/subdomain1/public_html

    The reason for the www path is so that there is a consistent folder structure for all domains and sub domains. Don't call it www. Call it base_url, call it html, call it JackSprat. It's just that calling it www, makes it consistent. The "base" url for a domain is "www".domainName. So the files for the "base" url for the domain go in the "www" folder.

    The reason to have a public_html folder within the www folder is the same reason that you have a public_html in the default cPanel setup; so that you can have files outside of the webroot for that subdomain.

    I've seen this on cPanel hosted systems. I want to know if/how I can configure cPanel to do it.
     
Loading...

Share This Page