Amazon Cdn And Ssl

Hi all, we're running Cs Cart 4.0.3 on a dedicated server. I'm looking to move our images to the Amazon Cloudfront service.



For anyone that's done this, I'm just wondering how you went with SSL for your domain? Do the images come in on its own url, for example; https://aws.cloudfront.com/myimage.jpg ?



Or have you guys created a CNAME record and have a wildcard SSL to allow for;



www.mywebsite.com

images.mywebsite.com



etc, etc.



I want to move over to the Amazon CDN a.s.a.p. as our dedicated server is handling a lot of connections, plus we're getting hit with excess data bills each month (our hosting in Australia is a lot more expensive and limited in bandwidth)

But I dont want to break the SSL for checkout, login etc (and my DEV server doesnt have SSL, its the one thing I can't test before going live)



Thanks,



Scott.

Yes, the images get their own URL. When the user is on a non SSL page, the image served is also non SSL. But this changes when they go to a SSL page. For example, I just added an item to my cart, and went to checkout. The image of the product in the cart now has a url beginning with https. So the URL of the images switches according to what kind of page is being served. Hope this helps.



(We have a GeoTrust QuickSSL installed on our server.)

Thanks Kingsley, that's very helpful. If I could ask another question… did you create a “bucket” with S3 first and then access that bucket via the Cloudfront app? I'm still finding my way around the Amazon products and terminology.



Cheers,



Scott.

To be honest, I can't remember. What I do remember is that there didn't seem to be any step-by-step guidance from CS-Cart on how to set it all up but I finally managed to work my way through everything and got it working. I just tried to access my Cloudfront console and it's down for maintenance. I'll check again later when the portal comes up again and let you know what I find.

Thanks mate, much appreciated. So are you only hosting images through Amazon? Or did you pop other static files up too? Have you noticed much of an improvement in page speed?



Thanks again.

[quote name='Scott_C' timestamp='1408803388' post='190401']

So are you only hosting images through Amazon?[/quote]

Not sure how I would know… I just checked the “Enable CDN” option in the CS-Cart admin.



Yes, definite speed improvements. My Gmetrix scores went from A/B to A/A.

I wonder if an S3 bucket needs to be created first or if we need to use our own subdomain.

I wonder how this works if you have multiple storefronts, I guess the cnd domain needs to be added to each storefront's SSL certificate.

[quote name='P-Pharma' timestamp='1408898812' post='190477']

I wonder if an S3 bucket needs to be created first or if we need to use our own subdomain.

I wonder how this works if you have multiple storefronts, I guess the cnd domain needs to be added to each storefront's SSL certificate.

[/quote]



Actually, you don't need an S3 bucket anymore. Cs Cart has done a really good job of implementing this. Here's a step by step for those who might be considering it;


  1. Create an account with AWS Amazon; http://aws.amazon.com/


  2. Click on your name in the top right corner and select “Security Credentials”


  3. Go to; Access Keys (Access Key ID and Secret Access Key)


  4. Create them.


  5. Go to your Admin in Cs Cart; Admin > Administration > Storage > CDN Settings


  6. Enter your keys


  7. CS Cart and AWS will sync up and create the distribution for you automatically. DON'T create one in AWS yourself as its redundant.


  8. You can jump back to AWS and go; Services > Cloudfront to see the progress of your Distribution being created. It usually takes around 10 - 15 minutes.


  9. Back in your Admin > Administration > Storage > CDN Settings - you can click a link that will test if the CDN is ready. Once it is, you check the box “Enable CDN”



    A word of warning; if you run SSL on your website dont use a CNAME it will break your site. Cloudfront is happy to provide the content as both SSL and non SSL with their own URL's. For example; http://d36563tr1.cloudfront.net/images/mypic.jpg and https://d36563tr1.cloudfront.net/images/mypic.jpg



    CNAME; If you dont have SSL on your site, and would like a “pretty url” for your Cloudfront, for example; www.mysite.com and; cdn.mysite.com - there is a cool video here showing how to do it with Wordpress; Set Up a CDN Using Amazon CloudFront | How To SEO - YouTube He explains the CNAME creation around the 5:30 mark.

Thank you for the step by step set up, I was using CNAME and I was getting errors.



Thak you again mate!

Welcome.

[quote name='Scott_C' timestamp='1409194269' post='190894']

Actually, you don't need an S3 bucket anymore. Cs Cart has done a really good job of implementing this. Here's a step by step for those who might be considering it;


  1. Create an account with AWS Amazon; [url=“http://aws.amazon.com/”]http://aws.amazon.com/[/url]


  2. Click on your name in the top right corner and select “Security Credentials”


  3. Go to; Access Keys (Access Key ID and Secret Access Key)


  4. Create them.


  5. Go to your Admin in Cs Cart; Admin > Administration > Storage > CDN Settings


  6. Enter your keys


  7. CS Cart and AWS will sync up and create the distribution for you automatically. DON'T create one in AWS yourself as its redundant.


  8. You can jump back to AWS and go; Services > Cloudfront to see the progress of your Distribution being created. It usually takes around 10 - 15 minutes.


  9. Back in your Admin > Administration > Storage > CDN Settings - you can click a link that will test if the CDN is ready. Once it is, you check the box “Enable CDN”



    A word of warning; if you run SSL on your website dont use a CNAME it will break your site. Cloudfront is happy to provide the content as both SSL and non SSL with their own URL's. For example; http://d36563tr1.clo…mages/mypic.jpg and https://d36563tr1.cl…mages/mypic.jpg



    CNAME; If you dont have SSL on your site, and would like a “pretty url” for your Cloudfront, for example; www.mysite.com and; cdn.mysite.com - there is a cool video here showing how to do it with Wordpress; https://www.youtube…h?v=uyVCW5EJqNU He explains the CNAME creation around the 5:30 mark.

    [/quote]



    hi,



    so you are saying i don't need to upload ssl to amazon manualy???

[quote name='demeldoo' timestamp='1415375652' post='196386']

hi,



so you are saying i don't need to upload ssl to amazon manualy???

[/quote]



That is correct.

yes you are right…works perfect :)



thanks for sharing… :D

I'm curious to know if your move to AWS Cloudfront improved your site performance. I tested it and found that page loads went from 1.5sec (images hosted locally - VPS/SSD) to 3.5sec (images on AWS).

I have seen decrease of inodes and file size on my server which is very good… and resources usage is getting normal. . What I notes it still calls my domain not the amazon…strange… But my store is still synchronizing. I have added amazon hour ago…

Checkout

http://www.demel.si



Tested with tools.pongdom.com

Looks like your site would benefit from gzip compression of javacript and CSS. You can enable that in config.local.php. Run it through http://gtmetrix.com/ to spot other areas of improvement.

[quote name=‘2020’ timestamp=‘1415387122’ post=‘196403’]

Looks like your site would benefit from gzip compression of javacript and CSS. You can enable that in config.local.php. Run it through [url=“http://gtmetrix.com/”]http://gtmetrix.com/[/url] to spot other areas of improvement.

[/quote]



hi 2020,



you mean to change :



‘gzip_css_js’ => false, // gzip compiled css/js files to true in the config file ?



thanks in advance :)

But when cname is not enabled it's not fully clouded. I belive according to the knowledge baee article we should upload our ssl to amazon and set cname in the qddon setting to get full benefit from this service

So can we use amazon cloud with SSL installed on the server? I need to switch from cloudflare.

i have it running :D



https://www.demel.si/



1-st year is free :D