• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Using files from another website (how to path?)

Markus Riedel

New Pleskian
Hello,
I'm having two websites registered/created in my plesk.
  1. websiteone.com
  2. websitetwo.com

I would like to use files from websiteone.com in websitetwo.com. I tried to use the path '../' operator to go back and than into the directory of websiteone.com. Unfortunately it didn't worked correctly, the domain failed.

How can I achieve what I'm trying to do?

Best regards,
Markus.
 
You could do it with a symbolic link. If you have an images folder in websiteone.com at httpdocs/images then you could:

cd /var/www/vhosts/websitetwo.com/httpdocs
ln -s /var/www/vhosts/websiteone.com/httpdocs/images images

That would make a symbolic link in websitetwo.com/httpdocs called images that linked to websiteone.com's images folder. Tested it with a text file on a couple of domains and it worked fine.
 
You may have a legitimate reason to do so, but generally speaking copy what you need across from websiteone.com to websitetwo.com

Although chubbas suggestion works, it is not advisable under most circumstances for security reasons. You're breaking a great security issue: site isolation.
 
You may have a legitimate reason to do so, but generally speaking copy what you need across from websiteone.com to websitetwo.com

Although chubbas suggestion works, it is not advisable under most circumstances for security reasons. You're breaking a great security issue: site isolation.

This is true - I live on the edge though :D Copying would be just as easy to set up, a little shell script run by cron to

rsync -avz /var/www/vhosts/siteone.com/httpdocs/images/ /var/www/vhosts/sitetwo.com/httpdocs/images/
chown -R sitetwoadminname:psacln /var/www/vhosts/sitetwo.com/httpdocs/images/

That way the second site has the right permissions on the files in that folder when it gets copies over.
 
You could do it with a symbolic link. If you have an images folder in websiteone.com at httpdocs/images then you could:

cd /var/www/vhosts/websitetwo.com/httpdocs
ln -s /var/www/vhosts/websiteone.com/httpdocs/images images

That would make a symbolic link in websitetwo.com/httpdocs called images that linked to websiteone.com's images folder. Tested it with a text file on a couple of domains and it worked fine.
Thanks for your answer. It worked! Unfortunately I'm getting 403 with each file with the websitetwo.com domain. Do you know why?
 
Thanks for your answer. It worked! Unfortunately I'm getting 403 with each file with the websitetwo.com domain. Do you know why?

Which solution did you use? The symlink or the rsync? 403 is the apache forbidden, usually means there is a permission error. So cd /var/www/vhosts/websitetwo.com/httpdocs

then

ls -al

and ls -al images

And look at the permissions that are set on the images folder and the images themselves and this should give you enough information to work out why you can't view the images in your browser. Any problems just paste the output of the ls -al here and we can work it out.
 
Back
Top