How to Change Document Root of Primary Domain in cPanel server
You must have root shell access for changing the primary domain document root in cPanel server, Use following steps to change document root of your primary domain in cPanel account:
Step 1: Use SSH to get shell access for your server as root account. Now edit following file.
USERNAME with your cPanel account name.
*ChangeDOMAINNAME.COM with your Primary domain name.
Step 2: After editing the mentioned file, search for textdocumentroot and change path as per your requirement.
Step 1: Use SSH to get shell access for your server as root account. Now edit following file.
# vim /var/cpanel/userdata/*ChangeUSERNAME /DOMAINNAME.COM
*Change
Step 2: After editing the mentioned file, search for text
documentroot: /home/USERNAME /public_html/NEW_PATH
Step 3: After making the changes, you need to rebuild Apache configuration file and restart Apache service. Use following commands to do it:
# /scripts/rebuildhttpdconf # service httpd restart
Your changes will be permanently updated now. Check your website for reflecting changes.
Comments
Post a Comment