Answers for "change main root directory cpanel"

0

change main root directory cpanel

1. access server terminal. using SSH or whatever you now
2. type "sudo su" in terminal to enter root access
3. $ sudo nano /var/cpanel/userdata/CPANEL_USERNAME/DOMAIN.COM
4. find following lines:
	documentroot: /home/USERNAME/public_html

	path: /home/USERNAME/public_html/cgi-bin
    
5. change "documentroot: /home/USERNAME/public_html" to "documentroot: /home/USERNAME/other-dir"
6. change "path: /home/USERNAME/public_html/cgi-bin" to "documentroot: /home/USERNAME/other-dir/cgi-bin"
7. type "sudo nano /var/cpanel/userdata/CPANEL_USERNAME/DOMAIN.COM_SSL" if you have SSL installed
8. find following lines:
	documentroot: /home/USERNAME/public_html
9. change "documentroot: /home/USERNAME/public_html" to "documentroot: /home/USERNAME/other-dir"
10. $ rm -vf /var/cpanel/userdata/username/domain.com.cache
11. $ rm -vf /var/cpanel/userdata/username/domain.com_SSL.cache
12. run "/scripts/updateuserdatacache"
13. run "/scripts/updateuserdomains"
14. run "cp /etc/apache2/conf/httpd.conf{,.bak-`date +%Y%m%d`}"
15. run "/scripts/rebuildhttpdconf"
16. run "/scripts/restartsrv_httpd"
17. last, run "service httpd restart" for restart apache service
	i use "sudo systemctl restart httpd.service" for centos 7
Posted by: Guest on July-20-2021

Code answers related to "change main root directory cpanel"

Browse Popular Code Answers by Language