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.

how to put primary domain document root to be in a separate subdirectory?

Discussion in 'General Discussion' started by axilaris, Dec 19, 2010.

  1. axilaris

    axilaris Registered

    Joined:
    Dec 19, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    when i use the cpanel Addon domains, creates a new subdir in the public_html as i specied. Thats fine.
    But now the problem is how can i make my primary domain1 to be in a subdirectory.

    Here is roughly how my directory structure looks like

    domain1\public_html\ <-------- this is the problem, i want it to be domain1\public_html\domain1.com
    domain1\public_html\cgi-bin
    domain1\public_html\domain2.com
    domain1\public_html\domain2.com\cgi-bin
    domain1\public_html\domain3.com
    domain1\public_html\domain3.com\cgi-bin
    domain1\public_html\domain4.com
    domain1\public_html\domain4.com\cgi-bin

    Thanks!
     
  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
    It is not recommended to change default documentroot as your addons will not be available via browser links http://domain1.com/domain2.com etc and this change may not be preserved during a migration. If you must do it, here are the steps.

    1- Log in via SSH as root and edit file /var/cpanel/userdata/domain1/domain1.com, you need to update document root from '/home/domain1/public_html/' to '/home/domain1/public_html/domain1.com' in this file.

    2- Rebuild apache configuration by running '/scripts/rebuildhttpdconf' without commas.

    3- Restart Apache.

     
Loading...

Share This Page