简体   繁体   中英

Symlink folder on websiteA within root folder of websiteB

I have created a symlink on websiteA for folder "test/" to point to root folder of websiteB:

ln -s /home/domainB/public_html /home/domainA/public_html/test

When I access www.domainA.com/test i keep seeing wordpress's 404 page and within apache error log i keep seeing "Permission denied" error; saying unable to check htaccess file, ensure it is readable and that '/home/domainA/public_html/test/' is executable.

Note: websiteA and B belong to different users and user groups.

I have tried adding userA to the same group us userB, but still had a same error message.


Update: The error message now is to do with access rights, even though both users are part of the same group, but I am still seeing the same page on the screen (404 page).

SoftException in Application.cpp:447: Mismatch between target UID (1004) and UID (1000) of file

Apache's permission denied errors usually mean that Apache cannot read the files.

Since Apache has access to one /home/ folder but not another, I assume Apache runs with special permissions per user. And in that case 1 user cannot access files from another user.

I would setup both domains in a more public path, eg /var/www/ when you can set up both domains and then the Apache will not have a problem with permissions.

For security reasons it is not possible to leave the current scope. So if the rootfolder for the webpage is /var/www/rootFolderA you can only access anything within this folder.

One workaround would be to have a folder enclosing both of the roots, eg /var/www/combine with /var/www/combine/rootA and /var/www/combine/rootB inside.

Then your domain needed to point to /var/www/combine which should refer you automatically to rootA by using eg a htaccess file. Then you could switch from rootA to rootB.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM