Magento, OnePica and Amazon S3 Configuration


I’m using Magento on Amazon EC2. Part of the infrastructure that I’m going to be using is Amazon S3 to handle user uploaded content and OnePica will manage it. My version of Magento is 1.7.

At the moment, OnePica is not officially supported on Magento 1.7 according to the download link. However, my coworker pointed out this is not true. The thing is that you need to manually install it rather than using Magento Connect (at least for 1.7).

Once you set that up, you need to work on setting up your Amazon S3 bucket. Setting up a basic bucket is easy. But I’ll walk through a basic setup:

1) You’ll need to make sure you get the credentials for OnePica so it can sync your images to S3. To get this information, you’ll need to go to this link. You’ll see an Access Key Id and a Secret Access Key. Copy these into the configuration (which is located under admin-> configuration -> Catalog/Image CDN -> Amazon S3/Cloudfront

2) Make sure that you have the bucket name you’ve defined in S3 as you’ll need that for the “Bucket” input box

3) For Base URL and Secure URL make sure you grab the right one. Something you can do is first synch your images (after completing the form) to S3. Then navigating to an image and opening it up (or looking at a product page; the image will not show up initially). Then copy the base url for these spots. I believe Amazon should support secure urls as well.

4) Make sure you choose Amazon S3/Cloudfront for the adapter under “General Settings” for Image CDN.

5) Save this part. Your catalog will now be synched to S3.

However, we’re not done. The next part involves making sure that people can access your content. Once you images are synched to S3, you’ll need to make them publicly available. Otherwise, you’ll run around for hours trying to debug 403 Access Denied messages.

So now, we’ll finish configuring your Amazon S3 bucket.

1) Go back to your Amazon S3 bucket. You should now see a directory (catalog).

2) Right click on the catalog directory and click on “Make Public”

3) Highlight your bucket and click on the Properties button

4) Under the first tab at the bottom, you should see the “Permissions” tab open. Right now, you’ll probably only see the owner with all permissions set. If you were not able to synch your images, that means you need to click on the “Add more permissions” button and select the “Authenticated Users” option. You’ll need to provide all permissions so that OnePica can synch to your S3 bucket

5) Finally, you will need to add a final permission for “Everyone”. For these people, you’ll need to make sure they have the “List” and “View permissions” options checked off.

Now, time to test this out. You can either reload your Magento page that has some images under catalog to see if they show up. I tend to use Firebug to make sure I’m not seeing 403 or 404 error codes. Also, you’ll start to see those images appear from Amazon.

(Visited 735 times, 1 visits today)

Comments

comments