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.

Pre defined folders in public_html

Discussion in 'General Discussion' started by broncha, Jun 12, 2009.

  1. broncha

    broncha Active Member

    Joined:
    Feb 3, 2009
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kathmandu,Nepal
    cPanel Access Level:
    Root Administrator
    Hi Folks

    I was wondering if this can be done somehow:

    If we could predefine few folders to be created automatically into the public_html folder like images and deny server listing(automatically) for that folder when a new account is created from WHM?

    This could be really helpfull.

    Thanks
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,463
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Sure. add them to the /cpanel3-skel/ directory of the reseller that creates the accounts, or, add them to the /root/cpanel3-skel/ if root creates the accounts.
     
  3. broncha

    broncha Active Member

    Joined:
    Feb 3, 2009
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kathmandu,Nepal
    cPanel Access Level:
    Root Administrator
    Hi InfoPro

    Thanks for that update.
    One thing.. Can u help me with some kinda script to iterate through the account folders in /home and copy a .htaccess file to the public_html folder?
     
  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    If that's the same for each account! You can skeleton copy that too!

    If you need to customize it, you can create a postacct script
    or other hooked script to update things after the account is built.
     
  5. broncha

    broncha Active Member

    Joined:
    Feb 3, 2009
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kathmandu,Nepal
    cPanel Access Level:
    Root Administrator
    Thanks for that Spiral but I need to copy the htaccess to the folders that already exists in /home.
     
  6. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Option A) Copy the .htaccess from /home to the skeleton folder

    *** Incidentally, by having .htaccess in /home, it is already automatically
    active for every account on your server even without copying it to the
    account because it is on a higher directory level for the account path

    Apache reads /home, /home/(user), /home/(user)/public_html, etc.
    when searching for .htaccess files and reads them in order as it
    comes to them so any .htaccess in /home is already read by Apache
    and used as the default .htaccess for the entire server



    Option B) Create a /scripts/wwwacct script to copy the file

    The script, /scripts/wwwacct, if it exists is executed automatically
    after any new web hosting account is created and details regarding
    the new hosting account are passed as command line arguments
    to the script. More details about how /scripts/wwwacct works
    and how to use it can be found on Cpanel's developer site.
     
    #6 Spiral, Jul 9, 2009
    Last edited: Jul 9, 2009
Loading...

Share This Page