Go Back   Website Hosting - VPS Hosting - Domain Registration Ireland :: Blacknight > Technical Support > VPS Hosting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-09, 05:57 PM
Junior Member
 
Join Date: May 2009
Posts: 11
Default Sharing images folder between 2 domains on Linux VPS with Plesk

Say x.com and y.com are both hosted on the same Linux VPS.
x.com/images stores images to be used on both x.com and y.com.
Ideally I would like to to just have one physical copy of the images on x.com and access this from y.com i.e. map or alias y.com/images to x.com/images.

From googling around, I see that this is a common thing to want to do and hear mentions of having alias commands in vhost.conf files on Plesk.
However, I know little about Plesk and do not have a clue how to proceed.

Is it possible to set this up easily on a Blacknight VPS?

Otherwise, the only way I can see of achieving this is to reference the full x.com URL on y.com whenever I want to use an image from x.com.

As well as thinking that this type of linking must be inefficient, this would also cause me issues as I won't always be sure which images exist on x.com and I don't want to be trying to display images on y.com that don't exist on x.com. On x.com, I can use file_exists() in my PHP script to check the images exist first as they are local files, but I can't do that from y.com, so it all starts getting a bit messy.

Any help on this would be appreciated. If I could just get over this one hurdle, it would make getting the sites up and running for both domains very easy.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-05-09, 06:13 PM
blacknight's Avatar
Administrator
Site Admin
 
Join Date: Aug 2003
Location: Ireland
Posts: 628
Send a message via ICQ to blacknight
Default

Without thinking too much about this ...

Could you use a mod_rewrite rule? ie. map /images to the source?
__________________
Please do not send me PMs for support issues - thanks for your understanding.
Blacknight Blog | VPS Hosting| Blacknight Technical Status Blog | Hosting Wiki |Speed Test|Webmaster Chat |Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-05-09, 08:40 PM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

Thanks for the quick reply on this.

I had wondered if htaccess could handle this alright, but if I used rewrite rules, I think I'd still be stuck for checking the images exist on the remote server. Plus, I figured that using rewrite rules would still be the same load server wise as just linking to the remote URLs, but I'm no sys admin so I could well be wrong there!

If the "virtual" images directory isn't possible on a Blacknight VPS, I'm thinking I may be best keeping track of the active image URLs in the database and on y.com work out which images exist on x.com based on that. I know that another workaround would be to store the images themselves in the database, but I'd rather not get into that.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-05-09, 08:43 PM
blacknight's Avatar
Administrator
Site Admin
 
Join Date: Aug 2003
Location: Ireland
Posts: 628
Send a message via ICQ to blacknight
Default

Hmmm

I'm not sure which is the best way to do it, but I'll see if I can get one of our sysadmins to look at this thread and possibly suggest a solution
__________________
Please do not send me PMs for support issues - thanks for your understanding.
Blacknight Blog | VPS Hosting| Blacknight Technical Status Blog | Hosting Wiki |Speed Test|Webmaster Chat |Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-05-09, 08:46 PM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

That would be brilliant thanks - much appreciated.

Thanks for the quick replies on a Friday night
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-05-09, 07:00 AM
Junior Member
 
Join Date: May 2009
Location: .de
Posts: 10
Default

how about the liunx command ln -s , for a symbolic link

How to: Linux / UNIX create soft link with ln command
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-05-09, 09:18 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

Hi Paul,

Thanks for your help. That sounds like it might do the trick. I will try setting that up and report back.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-05-09, 10:25 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

I've got my symlink set up, but am getting 403 errors when I try to access URLs under the symlink. After chatting online with support, I've sent in a ticket for further investigation. Fingers crossed it can be sorted!
Thanks again,
Janine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 11-05-09, 03:43 PM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

Googled and found a fix for my 403 permissions error: adding the following line to the htaccess file on the domain with the symlink:
Options +FollowSymLinks

It's great to have this working, but I'm just wondering if there's any downside to turning this on in htaccess?

Thanks,
Janine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
domains, folder, images, linux, plesk, sharing, vps

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:08 PM.


VPS Hosting Web Hosting Ireland Blacknight Blog Blacknight Status

Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2010, Jelsoft Enterprises Limited.

SEO by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17