• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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