Change Account Doc Root Question
I am wondering if there is a way to point a cPanel account's primary SSL domain documentroot to a folder that owned by another account
-
You can yes, but there would be issues since the accounts ownership would be different. You would modify this file: /var/cpanel/userdata/$cpuser/domain.com_SSL then modify the line: documentroot: /home/$cpuser2/public_html Again, you will run into issues since the other accounts files will be owned by a different user. Once you update that file, make sure to run: # /scripts/rebuildhttpdconf # /scripts/restartsrv_httpd0 -
Thank you for the answer. I already tried to change those lines in domain.com and domain.com_SSL files and got 500 internal server error. So, what should I do to get rid of that server error? Regards 0 -
You can yes, but there would be issues since the accounts ownership would be different. You would modify this file: /var/cpanel/userdata/$cpuser/domain.com_SSL then modify the line: documentroot: /home/$cpuser2/public_html Again, you will run into issues since the other accounts files will be owned by a different user. Once you update that file, make sure to run:
# /scripts/rebuildhttpdconf # /scripts/restartsrv_httpd
Hello. Thank you for the answer. I already tried to change those lines in domain.com and domain.com_SSL files and got 500 internal server error. So, what should I do to get rid of that server error? Do you have any idea? Regards0 -
Yeah again, its most likely because you are trying to access files that belong to a different user. PHP runs as the cPanel user, so basically, user1 is trying to access files owned by user2. Try: # tail -f /usr/local/apache/logs/error_log
then while you are tailing that log, hit refresh a few times in your browser, then copy / paste the results here.0 -
Yeah again, its most likely because you are trying to access files that belong to a different user. PHP runs as the cPanel user, so basically, user1 is trying to access files owned by user2. Try:
# tail -f /usr/local/apache/logs/error_log
then while you are tailing that log, hit refresh a few times in your browser, then copy / paste the results here.
Here is the result; [client MYIPADRESS:64317] SoftException in Application.cpp:447: Mismatch between target UID (522) and UID (528) of file "/home/vipplaket/public_html/v2/index.php" [Mon Feb 27 20:02:23.347755 2017] [core:error] [pid 28666:tid 139834783893248] By the way there is an index.html file and some pictures connected to it on /public_html/ folder. The domain works and opens that index.html file and its attachments when I try to point it to the folder /public_html/ 500 error occurs when I point it /public_html/v2 folder. Permissions of /v2 folder is 755. I also tried to change its permissions 750, error changed but didn't work again. Here is the result of permission 750; [Mon Feb 27 20:15:51.778088 2017] [core:crit] [pid 18232:tid 139834930751232] (13)Permission denied: [client MYIPADDRESS:64849] AH00529: /home/vipplaket/public_html/v2/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/vipplaket/public_html/v2/' is executable, referer: domain.com/ The original website also doesn't work when I change permissions to 750 Regards0 -
Hello, You can find discussion of this topic on the following thread: symlink to dir in different home directory Thank you. 0 -
Thank you @cPanelMichael, I checked the link you gave. But I'm not sure symlink is what I want to do. I use a VPS and all accounts on that VPS are mine. I want to create a multistore system and I need to point several domain names (with dedicated IPs and SSL certified) to one core folder on my VPS. I've been trying something so far. I've edited some files of accounts under /var/cpanel/userdata/ folder and successfully pointed an account primary domain to another account's root folder. I can access all html and image files via this way, but php scripts won't run and turns 500 internal server error. I think it's because permissions. Can you please tell me if there is a way to make this system web work. Regards 0 -
Hello, The referenced thread discusses the use of a symbolic link, but the same restrictions would apply when attempting to share a directory owned by another user. I use a VPS and all accounts on that VPS are mine. I want to create a multistore system and I need to point several domain names (with dedicated IPs and SSL certified) to one core folder on my VPS.
You'd need to setup a single cPanel account and add each domain name as Addon domains to the account if you need to share a directory. Otherwise, you're going to encounter file ownership issues. Another option is to setup a cron job that copies the same set of files to each account so that each individual account owns the files they are attempting to access. Thank you.0
Please sign in to leave a comment.
Comments
8 comments