Report this

What is the reason for this report?

Move Opencart Image Folder To Spaces

Posted on November 26, 2018

Hi, I would like to move my /upload folder of Opencart to Spaces. Is there any ways or guide which I can refer to do this? I want to utilize the built in CDN from spaces to speed up my Opencart website. Thank you.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey friend,

While you can do this with s3fs, I would actually recommend using our Volumes instead. Volumes are going to have less permission issues than a fuse mount. You could rename the images folder temporarily, create a new one, and then mount the volume in that folder. So, for example, let’s say these are the variables:

  • Volume: /dev/sda
  • Folder: /var/www/images
  • Web server user: www-data

I would run these commands, personally:

mkfs.ext4 /dev/sda
mv /var/www/images /var/www/images.bak
mkdir /var/www/images
mount /dev/sda /var/www/images
mv /var/www/images.bak/* /var/www/images
chown -R www-data. /var/www

Hope that helps :)

Jarland

Moving your /upload folder in OpenCart to DigitalOcean Spaces and utilizing the built-in CDN is a great way to improve your site’s performance.

After uploading your files to Spaces, you need to update OpenCart to serve these files from the new CDN URL. You can use an OpenCart extension to automatically rewrite URLs for assets to point to the CDN.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.