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.

Change the "document root" of a domain

Discussion in 'General Discussion' started by ramzez, Dec 2, 2008.

  1. ramzez

    ramzez Registered

    Joined:
    Dec 2, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi all

    I am newbie to the forum although fairly familiar with Cpanel in general.

    I have a website that has two domains. One French and one English. They share the same root folder although the English files are in a subfolder.

    I need to figure out how to change the "Document root" of the English domain to a subfolder of the French root.

    In case you have no idea where I get "document root" from... In "Addon domains" one of the listed information is "document root" but I can't change it.

    So where can I change that?

    Thanks newbie Ramzez
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can change the document root of a sub-domain by removing the sub-domain then re-adding it. This will not affect any of the files on the server unless you choose to delete the files yourself.
     
  3. ramzez

    ramzez Registered

    Joined:
    Dec 2, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I see what you mean however its not a subdomain that I am talking about.

    However your your suggestion applies to both subdomains or domains.

    Thanks
     
  4. apscinsspl

    apscinsspl Well-Known Member

    Joined:
    Mar 15, 2008
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    Allo document root information is stored in:

    /etc/httpd/conf/httpd.conf file

    You can edit that file and make the changes for Document root.

    After saving the changes just do

    service httpd restart
     
  5. ramzez

    ramzez Registered

    Joined:
    Dec 2, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Speaking for most newbies....I have no idea what the f### you are talking about. ;-) All the controls I use are GUI. Those instructions do not look GUI to me.

    Ramzez
     
  6. apscinsspl

    apscinsspl Well-Known Member

    Joined:
    Mar 15, 2008
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    16
    The httpd.conf is not to be edited via a GUI but via ssh , secondly if you want to change the document root for addon domain, delete and readd it and mention the document root for it as the folder name in which you uploaded files for it.
     
  7. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    In cPanel 11, custom changes made to httpd.conf will not be preserved. httpd.conf is generated based on /var/cpanel/userdata/ data. If you need to change the document root for a domain then it needs to be changed in /var/cpanel/userdata/username/domain.com. After that you need to rebuild httpd.conf as:

    /usr/local/cpanel/bin/build_apache_conf

    If you don't have root ssh access, then it won't be possible. You need to contact the Host/Provider in that case.
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Portions of httpd.conf can be edited indirectly via WHM by going to WHM -> Service Configuration -> Apache Configuration.
     
  9. sunil001

    sunil001 Member

    Joined:
    Oct 19, 2005
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Hi,

    I dont think this is a big issue, please ask your hosting provider to chnage the DocumentRoot for your english domain.

    vi /usr/local/apache/conf/httpd.conf

    find your english domain virtualhost entry, and change the documnetroot

    Regards
    http://ehostpros.com/
     
Loading...

Share This Page