Changing A Primary Domains Root Folder

Discussion in 'cPanel Guides' started by Chuck, Nov 29, 2018.

  1. Chuck

    Chuck Administrator
    Staff Member Grep What?

    Joined:
    May 17, 2017
    Messages:
    38
    Likes Received:
    0
    Normally the primary domain is served from /home/username/public_html, but at times a user may want this changed. It is a quick and simple adjustment.

    Code:
    cd /var/cpanel/userdata/username
    
    nano domain.com
    Modify the following two lines:
    Code:
    documentroot: /home/username/public_html
    path: /home/username/public_html/cgi-bin
    As and example, they could look like:
    Code:
    documentroot: /home/username/public_html/kickassd
    path: /home/username/public_html/cgi-bin/kickassd
    Note: If the site is using https you also need to modify domain.com_SSL which is in the same directory. Look for line:
    Code:
    documentroot: /home/username/public_html
    Modify it same as you did for the first file. Once ready you do:
    Code:
    /scripts/rebuildhttpdconf
    Restart webserver gracefully either through WHM or:
    Code:
    service httpd graceful
     

Share This Page