Custom Domain for S3 Files - amazon-web-services

This should be easy as there is no shortage of pages on custom domains and S3 but for some reason I can't seem to get it to work as expected.
I have a S3 Bucket full of videos. The S3 bucket is called for example "videos.foo.com". I bought the domain "videos.foo.com" and set it up in cloudflare with the cname "videos.foo.com" pointing to "videos.foo.com.s3-website-us-east-1.amazonaws.com".
I can view files in my bucket by going to there full url such as "videos.foo.com.s3-website-us-east-1.amazonaws.com/myvideo.mpg".
My problem is I can't view them by going to "videos.foo.com/myvideo.mpg".
I tried enabling "Redirect all requests to another host name" and entering "videos.foo.com" but that didn't work either. To note, I will 'not' be hosting a site at "videos.foo.com" just serving files.
All the files have permissions everyone: open/download.
If anything sees the error in my ways please let me know. In the mean time I'll keep searching and going through trial and error. Thanks!

Nginx S3 proxy helps to solve that problem, please check more details: https://stackoverflow.com/a/44749584/290338
A bucket can be named differently, the only performance rule is to have EC2 and a bucket in the same geo location.

You may need to configure the Route 53 record as an alias rather than a cname. In R53, edit your record set and configure it like this -
Type: A - IPv4 address
Alias: Yes
When you click in the Alias Target textbox it will drop down a list that contains your S3 bucket (if it's properly configured). It can take a while to load that list so be patient. Select your bucket and hit save.
Check out this document for more info - http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

Related

Static website note showing up on google cloud platform

I have followed the instructions given on https://cloud.google.com/storage/docs/hosting-static-website, yet my domain name still lands on the page with this error:
This site can’t be reached
afrikincm.com’s server IP address could not be found.
Search Google for afrikincm
ERR_NAME_NOT_RESOLVED
My doamin registrar is goDaddy.com and all i did there was:
see godaddy dashboard
All objects added to my bucket on Google Cloud Platform have been made public yet something still doesn't seem to be working right.
I really will appreciate some help here guys.
Thanks
It seems that something is wrong and somewhere down the line and the DNS record is not resolving to the content of your gcs bucket.
First of all, be sure that the bucket name is exactly the value that you are specifying as CNAME.
Then review and re-take the steps suggested in the documentation.
Make sure that billing is enabled
Verify that you own and manage the domain that you'll be using: webmaster central
Create a CNAME record that points to c.storage.googleapis.com
Create a bucket whose name matches the CNAME you created for your domain
put files in your bucket (like an index.html)
make all object public with gsutil iam ch allUsers:objectViewer gs://[BUCKET_NAME]
setup index + error page with: gsutil web set -m index.html -e 404.html gs://[BUCKET_NAME]
Judging from the error, it seems that something is wrong with the godaddy records or the bucket name or the verification step :)

How do I route multiple domain names to the same amazon S3 bucket location?

I have hosted react application on s3 bucket.
I want to access that same application with different domain name.
For Example:
www.example.com, www.demoapp.com, www.reactapp.com
I want to access s3 bucket hosted application with different domain.
How can I do that ?
Is there any other Amazon services do I need to use ?
if you have done something like this then please help me.
Use amazon cloudfront and you should be able to do this: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html
You won't be able to do it as a standard s3 static website, but using cloud front will make it possible.
Using Amazon CloudFront Distributions service we can achieve it.
1) Create new CloudFront Distributions service,
2) select the bucket name that you want to use
3) add multiple domain name which we want to add
4) CloudFront Distributions will generate new host something like
abcded.cloudfront.net
5) Add abcded.cloudfront.net that in our original domains CNAME record.
If you are trying to route multiple domain names to the same S3 bucket then you are doing something wrong and you need to re-think your strategy.
domain names are meant to be a unique way of identifying resources on the internet (in this case its your S3 bucket) and there is no point of routing multiple domain names to the same S3 bucket.
If you really want to do this, then there are couple of options:
Option one:
Easy option is to point domain1.com to the S3 bucket and then have redirect rule that redirects requests to domain2.com and domain3.com to domain1.com.
Option two:
Another way is to create 3 S3 buckets and duplicate the content on all 3 and then use different domain names to point to each one. This of course is going to create a nightmare maintenance scenario as if you changed the application in one bucket then you have to do the same change in all other buckets. If you are using GIT to host your application then you can push to all 3 S3 bucket at once.
Again, all of the above is really nothing but a hack to get around the fact that domain names point to unique resources on the internet and I can't really see why would you do something like this.
Hope this gives you some insight on how to resolve this issue.

AWS - Create a record set for an s3 static website

I have a static website up and running at
http://volcalc.s3-website-ap-southeast-2.amazonaws.com/
It is stored on an aws S3 bucket.
I have bought the domain volcalc.io
I just want to switch to use that as the url of my website.
I'm following the instructions here. I'm doing "Create record sets".
I'm trying to create a record set but when I check the radio button "yes" for "alias" then I try to enter an "alias target" there are no options to select from and the tutorial is saying there should be:
So I just tried to paste in this: http://volcalc.s3-website-ap-southeast-2.amazonaws.com/
and click create but it says:
The record set could not be saved because:
- Alias Target contains an invalid value.
What do I enter into alias target? Why aren't there any options to select from?
I know you might have solved the issue, but for the people who see this post:
If you cannot find the endpoint on the list, simply copy and paste it there.
Also you would need to remove the bucket name from your end point.
only input this part: s3-website-ap-southeast-2.amazonaws.com/
Route 53 will find a bucket that has your exact domain name.
You will need to point your alias record to the resource, not the endpoint :
ALIAS : s3-website-ap-southeast-2.amazonaws.com
Steps required:
Create a bucket with the name of the desired domain (eg A bucket called volcalc.io)
Turn on Static Website hosting
Create a Route 53 record set with Alias=Yes and select the static website from above
See: Routing Traffic to a Website that Is Hosted in an Amazon S3 Bucket
If you are trying to create the record but your s3 bucket is not showing up,
check that the bucket name matches the name of the subdomain / domain you are trying to setup.
For example, if my subdomain is www.passioncloud.net then I must make sure the name of my bucket is also www.passioncloud.net .
See: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/RoutingToS3Bucket.html

Amazon web hosting URL not changing

Just hosted a website on amazon aws in a s3 bucket. When I move around in the website the URL doesn't change, even if the link redirect on a page with a different path.
I read around that it has something to do with iframes, even though I'm not sure what they are.
Regardless, I'm just wondering whether it's possible with the aws s3 to make so that by moving around in the website, the URL gets updated as well.
For testing purposes, this is the link to the website, and to go to another part of the website, just scroll down and click on the website image.
Thank you!
I've manage to find out how to connect the web hosting s3 bucket to the freenom free domain provider.
The s3 bucket needs to have the same name as your domain + the "www". In my example my domain was paolo-caponeri.ga, the bucket needs to be www.paolo-caponeri.ga
Then in the freenom domains manager you need to go the name servers section, select the "Use default nameservers" and then press "save"
Finally you need to go to the freenom DNS manager and add a new CNAME record with "www" on the left and the full link to the s3 bucket provided in the amazon s3 properties on the right; in my case it was "www.paolo-caponeri.ga.s3-website.eu-central-1.amazonaws.com"
And that's it, after a while you should be able to connect to your website without having the URL being masked.
(thank you to Frederic Henri, who got me much closer to the answer!)
NB: I have no experience with freenom so those are more advices than a proven solution.
It seems freenom is doing frame forwarding and you would need instead a "A" / "CNAME" referral.
Your site runs fine if you go to http://testpages.paolo.com.s3-website.eu-central-1.amazonaws.com/ and as such bypass the freenom redirection.
A quick search on freenom seems it could be possible: https://my.freenom.com/knowledgebase.php?action=displayarticle&id=4

Amazon Web Services Route 53 / S3 unable to point to my registered domain

This is another problem I am having, here is the info.
My endpoint for the first bucket works, but not the 2nd bucket, and using my domain name in the browser just doesn't work at all.
Once again I have taken screenshots, this is driving me insane, I have no idea how to correct it, it just doesn't find my root or something.
Record Sets
Buckets
I can't post more than 2 links
If anyone can help me, even PM me, I'll give my login details to take a look, because I'm completely stumped.
You should follow the directions on Setting Up a Static Website Using a Custom Domain.
For the first bucket, the steps are:
Create an Amazon S3 bucket with the same name as your domain (justdiditonlne.com)
Add a bucket policy to make the content public, or modify desired objects to make them publicly accessible
Turn on Static Website Hosting, and you will receive a URL like: justdiditonline.com.s3.amazonaws.com
Create a Route 53 entry for justdiditonline.com, type A, set Alias=Yes and enter the static website hosting URL
For the second bucket:
Create an Amazon S3 Bucket with the desired domain name (www.justdiditonline.com)
Turn on Static Website Hosting, but this time select Redirect all requests to another host name. Enter www.justdiditonline.com.