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

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/

Related

How can I host my website on an EC2 Server using Apache but host my images on S3 under the same sub domain?

So I have my website hosted on an EC2 server running apache. All works fine and well.
The issue I'm having is that I want my images hosted on S3 (and possibly cached on CloudFront), not on my EC2 server, but want both accessible under the same domain/subdomain.
For example say my website is www.helloworld.com. I want my images to be accessible at www.helloworld.com/images/foobar.png. I want foobar.png to be hosted on S3 and not each one of my EC2 servers though. How can I go about doing this?
Is there and configuration I can do in the AWS console or are there any rewrite rules I can use in Apache? I know I could always just set up a controller that will download the images from S3 and forward them to the user, but this seems wrong to me.
For that you need to put a load-balancer/proxy in front to intercept all requests and dispatch accordingly. That may not be a bad idea anyway (for availability reasons), but a separate host name for images should not be a problem, either (it's not like users will have to see or type those URL).
Using CloudFront, you can have CloudFront receive the initial requests, then based on the path, forward the request to either your EC2 instance or to your S3 bucket.
For example, you could setup the following:
A CloudFront behaviour that upon a path under /images/ would use an S3 origin, and
A default (for everything else) would go to your EC2 instance origin.

How to point Amazon S3 bucket to test subdomain like images.develop.example.com

Currently I'm using Amazon S3 bucket for my website like images.example.com .Today I also built a test subdomain for development purposes and it is served in develop.example.com
Now I want to use Amazon S3 bucket like develop.images.example.com or images.develop.example.com (I don't know which of them is correct)
Is it possible according to S3 restrictions?
Because Amazon says: You must have same bucket name with your subdomain. So I was create a bucket like images.example.com
and my cname record is: images.example.com.s3-website.eu-west-2.amazonaws.com
My webserver is Apache and runs on Ubuntu
How can reach to my images on my development subdomain?
Should I create a new cname record?
Should I do something on my virtual host file?
or what?
To share static content from develop.images.example.com:
Create an Amazon S3 bucket called develop.images.example.com
Turn on static website hosting
Create a Route 53 A record for develop.images.example.com with Alias=YES and point it to your S3 bucket
This is the same process as you would have followed for images.example.com.

Multiple subdomains for Amazon S3 Bucket?

We are white labelling site so that mysite.com and site.com and site2.com all share the same code base but different front end UI. They use a lot of the same images, including product images, which are hosted on Amazon S3. The s3 bucket name is based off site.com such that the host is:
https://siteDOTcom-new.s3.amazonaws.com/
Now, we don't care what the Amazon S3 url looks like but some clients do, so we're trying to figure out how to do it. We've tried CNAMEs but that didn't work out. Is it possible to have multiple subdomain aliases for the same S3 bucket?
You should look into Amazon Cloudfront for two reasons:
It would allow you to point to the same s3 buckets with different URLs (e.g. http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html)
As a CDN, it will give better downloading speeds for people using your site

Do you know cloud storage supporting restriction to many folders by different domain?

We are looking for reliable cloud storage which have a function to set restriction to access files in folder for requests from predefined domains? For example:
I can download file by url http://cool-storage.com/resource-folder1/file.bin from sites http://mywebsite.com and http://yourwebsite.com. But I can't download file.bin from site http://theirsite.com.
We tried to use Amazon S3, but it has this functionality only for bucket, not to folders or files inside it. Also Amason S3 has limit to bucket creation.
Has anyone similar task?
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