How to change the document root of your main domain in WHM/cPanel

不言
Release: 2019-03-18 14:33:48
Original
3813 people have browsed it

cPanel/WHM is a web-based control panel for managing complete Linux operating systems. All cPanel accounts are created using a primary domain. This article will introduce the documentation for changing the primary domain of a cPanel user.

How to change the document root of your main domain in WHM/cPanel

You must have root shell access to change the primary/primary domain document root in cPanel, please use the following steps to change the document root of the primary domain in your cPanel account Root directory.

(Recommended: Linux Video Tutorial)

Priority: Must have ssh access to the root user of the cpanel server.

Step 1: Log in to the CPanel server

Get shell access to the server as the root account using ssh, using your favorite ssh client. Connected to the server using Putty. Now edit the following files.

# vim /var/cpanel/userdata/USERNAME/DOMAINNAME.COM
Copy after login

Step 2: Update documentoot

After editing the file, search for the text document root and change the path as needed.

documentroot: /home/USERNAME/public_html/NEW_PATH
Copy after login

Step 3: Rebuild and Restart Apache

After making the changes, we need to rebuild the Apache configuration files and restart the Apache server. Use the following command to do this.

# /scripts/rebuildhttpdconf
# service httpd restart
Copy after login

Done.

This article has ended here. For more exciting content, you can pay attention to other related column tutorials on the PHP Chinese website! !

The above is the detailed content of How to change the document root of your main domain in WHM/cPanel. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template