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 Document root directory

Discussion in 'General Discussion' started by Leon savvides, Sep 8, 2016.

  1. Leon savvides

    Leon savvides Member

    Joined:
    Sep 2, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Polis
    cPanel Access Level:
    Root Administrator
    how set document root rather default public_html/ to /public_html/webroot/ ?
    this is a cake php site and and needs document root be on webroot?

    I have cpanel 58 & centos 6.8
     
    #1 Leon savvides, Sep 8, 2016
    Last edited by a moderator: Sep 8, 2016
  2. lldeepakll

    lldeepakll Well-Known Member

    Joined:
    May 20, 2012
    Messages:
    86
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    India
    cPanel Access Level:
    Root Administrator
    You can do it in following way:

    Open the file /usr/local/apache/conf/httpd.conf using any text editor (vi or nano)and go to the virtualhost section of the domain name for which you want to change the DocumentRoot.

    Replace the following line
    DocumentRoot /home/username/public_html (username is your actual cpanel username)

    with new one
    DocumentRoot /home/username/public_html/webroot

    Save the file.

    Restart the apache service using following command
    # /etc/init.d/httpd restart

    You also need to run the command below which will run the cPanel Apache Distiller. This will prevent cPanel and Apache from removing any changes you made whenever Apache gets recompiled.

    # /usr/local/cpanel/bin/apache_conf_distiller --update


    Thanks
     
  3. Leon savvides

    Leon savvides Member

    Joined:
    Sep 2, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Polis
    cPanel Access Level:
    Root Administrator
    are you from forums admin...
    can you give and some urls (for this action) to be double correct, and trust

    by running distiller and after a while remove a domain ... will be any problem???
     
  4. Leon savvides

    Leon savvides Member

    Joined:
    Sep 2, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Polis
    cPanel Access Level:
    Root Administrator
    exist and .htaccess way change document root?
    /public_html/webroot
     
Loading...

Share This Page