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.

SOLVED How do I change the default directory of domains?

Discussion in 'General Discussion' started by bb_simon, Dec 13, 2016.

  1. bb_simon

    bb_simon Registered

    Joined:
    Dec 13, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Hi all,

    I've been looking around for information on this but can't find what I'm looking for.
    What scripts do I need to modify to have VHM create directories like these by default:

    /home/<user>/<primarydomain>/public_html
    /home/<user>/<addondomain>/public_html
    /home/<user>/<subdomain>/public_html

    On top of that I'd like the following directories created for each of the above:

    /home/<user>/<domain>/sessions
    /home/<user>/<domain>/logs
    /home/<user>/<domain>/tmp_upload_dir

    And of course set up the vhosts accordingly.
     
  2. bb_simon

    bb_simon Registered

    Joined:
    Dec 13, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    I find so many discussions about this - old as new - but no solutions. There gotta be some (hacky) way to do it right?

    After reading more I guess it could be summarized as: I need the primary domains of my users to be treated like addon-domains.

    Anyone? What is the solution?

    According to a cpanel-worker(?) this has been implemented (Addon domains created at account root as a folder) but I cant find a trace of it in Tweak Settings.
     
    #2 bb_simon, Dec 13, 2016
    Last edited by a moderator: Dec 15, 2016
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This will require a custom application that utilizes a standardized hook:

    Guide to Standardized Hooks - Software Development Kit - cPanel Documentation

    You'd need to first develop a script that creates the directories of your preference and makes the changes to the documentroot outlined on threads like this. Then, configure the custom script to run at the post account creation stage of the Accounts::Create hook documented at:

    Guide to Standardized Hooks - Whostmgr Functions - Software Development Kit - cPanel Documentation

    Note the feature referenced in your last response is intended for addon and subdomains, not new accounts.

    Thank you.
     
Loading...

Share This Page