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.

Configure Add-On domain's document root to be relative to my account's home dir

Discussion in 'Data Protection' started by r_honey, Aug 1, 2009.

  1. r_honey

    r_honey Member

    Joined:
    Aug 1, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    My Hosting provider allows me to add multiple Add-on Domains in addition to the main domain.

    I enter the following in the Add-On domain page:
    New Domain Name: example.com
    Document Root: /example.com

    (Other details are not relevant to this thread).

    However, to my surprise, cpanel creates 2 directories in my Hosting space's root directory:
    /example.com
    /public_html/example.com

    However, the second one (/public_html/example.com) is the actual document root.

    This creates multiple problems for me (not to mention that a domain root should not be inside another's domain root logically), like when I backup the main domain files, Add-On Domain files are also backed up, a user having FTP access to main domain's root can change any add-on domain's files.

    So, is there any way to configure /example.com as the root for the add-on domains??
    I am using cPanel Accelerated!!
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Well this shouldn't happen since you define documentroot as /example.com, however once created, you can do this to change documentroot.

    1- edit the file /var/cpanel/userdata/user/example.yourdomain.com and change document root to /home/user/example.com
    2- /scripts/rebuildhttpdconf
    3- Restart Apache.
     
  3. r_honey

    r_honey Member

    Joined:
    Aug 1, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I could not find /var directory in my Hosting space. Also, a search for any directory named userdata or user also returned nothing.
     
  4. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    To have access to the above files, you need to be 'root'
    From your comments , I assume that you are on a shared hosting server. hence, you should contact your provider for the changes to be made.

    However, I should add that 'add-on' domains are used to point to a sub-directory within the main domain. So, the doc-root will be located inside public_html by default.
     
  5. r_honey

    r_honey Member

    Joined:
    Aug 1, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Yes, I am on Shared Hosting. And I have contacted the provider. I thought this could be managed from CPanel though.
     
  6. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Unfortunately no, to manually edit cpanel user's userdata files, you must have root access.
     
Loading...

Share This Page