How to change Home directory in CPanel
Hello,
I'm a newbie in this cpanel and hosting things.
Somehow my home directory visible on cpanel has been changed from /home/admin/public_html to /var/www/html.
All of my code is in /home/admin directory but now i am not able to view those files.
Learned from some previous threads, I checked the file /var/cpanel/userdata/USERNAME/DOMAIN.COM
for documentroot: /home/USERNAME/public_html .
It seems like everything is fine in that file. But still the home directory is not getting updated.
Can Someone please help me out here..?
PS: Please find attached a screenshot of my cpanel, and the highlighted new home directory.
-
Hey there! Thanks for joining the forums and talking with us! If the data in the userdata file is correct that's a good thing. I would also recommend manually checking the Apache configuration to see if the wrong data is present there. If so, you can run the following commands to backup and rebuild the Apache configuration using the correct information from the userdata file: cp /etc/apache2/conf/httpd.conf{,.bak-`date +%Y%m%d`} /scripts/rebuildhttpdconf /scripts/restartsrv_httpd
Can you try that and let me know how it goes?0 -
Thank you for your response. I ran those commands at an escalated root level. For first command i didn't get any noticeable response, second and third commands seamed successfull. but the home directory in cpanel is not yet changed.. 0 -
That's correct - the first command wouldn't have given any output. That's interesting though, as by default cPanel creates everything in the /home/ directory. Was there any special tool used to create this account, or was this done through WHM? Is this issue only happening with one domain on the system? 0 -
This issue has been now resolved. Some random youtube video had wrongly guided me to use usermod -d command with a different directory. Being very new to this field i followed it without a second thought. But now it was resolved. Thank you so much for your help Rex. :) 0 -
Glad to hear you were able to get this fixed! 0
Please sign in to leave a comment.
Comments
5 comments