Jump to content

Specify external folder for images (another website)


huggettm

Recommended Posts

Hi, I run a few sites that have shared images, I have always done this via sym link but it is causing issues recently.

rather than that, or repeat the images for each website - is it possible to redirect the images to be sourced from another website location rather than the folder images/source?

Link to comment
Share on other sites

They are stored in the file manager too. Do you have a shared database? Can't see how you have even made this work at all. 

Could you alias an Amazon S3 bucket and use mod_rewrite to change the image URL's to serve them from the cloud? 

I'm sure its doable if you have the patience. 

Link to comment
Share on other sites

Are you interested in just the source of the images being in a specific location?

CubeCart skins create specific sized renderings of those source images and save them in /images/cache/. CubeCart then gives the appropriately sized images in that cache as the URL to the storefront skin template. So, most, if not all the product images are coming from your site anyways.

In admin, when an AJAX request is made for a list of source images and files for the image picker and digital file picker, there must be an API script to receive that AJAX request, interpret it, and send back the JSON response.

I think it wouldn't be too hard to make slight edits to where CubeCart sources images - assuming your site has permission to reach out - at server level - to outside locations.

 

Link to comment
Share on other sites

they have come back now and confirmed it was an issue with the link ownership.

I might look into other options though, particularly hosting all the images seperately for google feeds etc so if it goes wrong again its not both websites and feeds all knocked out in one.

Link to comment
Share on other sites

Just now, huggettm said:

they have come back now and confirmed it was an issue with the link ownership.

I might look into other options though, particularly hosting all the images seperately for google feeds etc so if it goes wrong again its not both websites and feeds all knocked out in one.

Makes sense. Can't say I blame them. Stuck between a rock and a hard place here... I suppose the only solution is to put all sites on one cPanel account if you want to use symlinks. However if one gets hacked they all get hacked. 

Maybe you do need to mirror or rsync the images/source folder.

I don't blame the hosting company for making this change. It's best for the greater good. 

Link to comment
Share on other sites

FYI anyone looking to use a sym link for multiple stores, I did it by installing cubecart so it creates its image folder structure, then creating the sym link afterwards to the source folder. 

I then updated the product images using the g7 data pump addon.

1 minute ago, Al Brookbanks said:

Makes sense. Can't say I blame them. Stuck between a rock and a hard place here... I suppose the only solution is to put all sites on one cPanel account if you want to use symlinks. However if one gets hacked they all get hacked. 

Maybe you do need to mirror or rsync the images/source folder.

I don't blame the hosting company for making this change. It's best for the greater good. 

its 40,000 images so I didnt want to have it copied on every website :)

but typing it out... yeh thats probably why it goes wrong lol

Link to comment
Share on other sites

So you should be able to do this then. I don't know if this would work but you could try creating a new linux user with its own group.

e.g. imgsrc:imgsrc with a home directory at /home/imgsrc

Then move all the images there and add each of your cPanel accounts to the "imgsrc" group and give all the account a symlink form their /home/{user}/public_html/images/source folder to /home/imgsrc. You might be able to take this further and symlink the images/cache folder to save more disk space. 

This is all theory and may not work at all but sounds doable. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...