Is it possible to fetch images from S3 to Ec2? - amazon-s3

I have the website built in Ec2. I want to put all images in S3 and then they are served on the website which is on Ec2. So how do I go about fetching images to act as images in img src code on pages in ec2?
Thanks

This might be helpful:
http://aws.typepad.com/aws/2010/11/amazon-cloudfront-support-for-custom-origins.html

Related

How to use two different AWS S3 accounts with CarrierWave?

I use CarrierWave to handle my Rails6 application images and assets on AWS S3. I want to migrate the assets part to Minio (so, still carrierwave-aws but, with a different configuration) while keeping the other image on S3.
Can I achieve such a goal with CarrierWave?
Thank you.

Using mod_pagespeed with Cloudfront and S3

We have a bunch of images that are loaded on Amazon S3. Right now we directly call these images with the S3 URL. I would like to install Cloudfront CDN and mod_pagespeed to resize these images and optimize them. The web server itself isn't hosted on Amazon at all.
How can I get Cloudfront to cache the mod_pagespeed's resized images? My idea was to spin up an EC2 instance and use it as a reverse proxy to S3. This EC2 instance would have mod_pagespeed installed. So it would go Cloudfront -> EC2 proxy -> S3. So far I haven't been able to get this to resize the images. It all works, just not the mod_pagespeed part.
We're not wanting the images to pulled to the web server out of Amazon as they would waste a lot of bandwidth. I want the images from S3 to be resized either on the new EC2 instance or some other way inside of Amazon.
Anyone have any recommendations?
Take a look at AWS Lambda - there are a number of examples of doing exactly what you're trying to do with it.

Drupal 7 not using CloudFront domain to pull images from Amazon S3

I have a Drupal7 deployment using Cloudfront CDN. The Amazon S3 and AWS modules are installed and configured. When I view the site (using a preprod domain) the CDN cloudfront domain is not visible in the image path just the local domain breaking the link to the images.
Any ideas?
This turned out to be a Network issue
is now fixed
Thanks

Hosting dynamic website in Amazon server

I am working on a project where we are hosting our files(only uploaded by the user) in S3 Amazon server. Now the problem is the contents hosted with amazon is loading fastly. But the JS, CSS and CSS images(Very small images) which hosted in our server is taking too much time to load. Is there anyway to host our entire dynamic website to Amazon S3 and is it possible to configure the DNS to amazon?
Host your static files to S3 as well.
Create a bucket named static.yourcompany.com
CName the bucket URL as static.yourcomapany.com
In your webpages, use absolute path for CSS, JS, images with base URL as http://static.yourcompany.com
You may want to leverage tools like JetS3t for syncing the files with the latest changes.
Refer:
How to alias your subdomain with S3
JetS3t Docs
Virtual Hosting of Buckets
Host Your Static Website on S3
You can also read this blog, the author has described the process in a very detailed manner
http://geekospace.com/hosting-static-web-sites-in-aws-simple-storage-service/
For the dynamic part of your website look into http://aws.amazon.com/elasticbeanstalk/ but route 53 is essentially a way to configure DNS to amazon. http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

Using amazon s3, upload files using their servers but URL should appear to be from mine

Is it possible to upload files to amazon S3, using their servers (i.e. my server shouldn't be used in the upload process)?
I also want the URL to appear to be uploading to my server, is this possible?
Look here for instructions on how to setup your CNAME record so that one of your subdomains can be an alias for an Amazon S3 bucket.
Depending on your needs, you might not want "s3.amazonaws.com" to appear on your web site or service. For example, if you host your web site's images on Amazon S3, you might prefer http://images.johnsmith.net/ to http://johnsmith-images.s3.amazonaws.com/