Failed to host a static website on AWS s3 - amazon-web-services

I have created my portfolio website, so now I would like to upload it on AWS s3.
I bought a custom domain name for it, but before using it, I can't even host my website with the endpoint URL (something like this: http://masahiro-takechi.com.s3-website-us-west-1.amazonaws.com). When I copied and pasted it on Google, it says "This page isn't working".
I believe I set proper settings to be able to host the website such as permissions and Static website hosting, and so on. Permissions are totally public, unblock access, generate correct bucket policy, and upload right folders and files like index.html.
All tips would help me greatly, thanks for your time to help me in advance!!;)

Your website should be in a root folder of the bucket. Otherwise, you have to access it using your folder:
http://masahiro-takechi.com.s3-website-us-west-1.amazonaws.com/engineer_portfolio_resume/index.html

Related

CloudFront No Longer works after modifying S3 bucket

I originally created an S3 bucket with a cloudfont to display the html code in the bucket at the publicly hosted domain hosted. I deleted the contents of the S3 bucket and uploaded new files. The endpoint for the S3 bucket displays fine in the web. The hosted url no longer works, I get an 404 error.
Failed to load resource: the server responded with a status of 404 ()
Could you please provide more details of your CloudFront distribution settings? I wrote this article explaining how Cloudfront and S3 works and how you can deploy React applications step by step! It might be useful for you.
Please have a look at: Medium - How to deploy single page applications to Cloudfront
I discovered my error. Instead of using the drop down menu for the orgin link I used the endpoint of the bucket. It works now.

Hosting react app on aws S3

I am trying to host my static application on aws s3 bucket. I have put my build folder files in bucket. It looks like this
But when I go to .s3-website..amazonaws.com index.jade gets downloaded instead of webapp getting opened.
I followed this tutorial https://www.fullstackreact.com/articles/deploying-a-react-app-to-s3/
How can I get my web app work?
Update:
When I changed content type of index.jade to text/html, the browser shows html text like this
Here is how I edit metadata key in aws console
now there is no download. But still web page is not getting served.
You need to enable static site hosting on your S3 bucket. To enable website hosting for an Amazon S3 bucket
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.
In the list, choose the bucket that you want to use for your hosted website.
Choose the Properties tab.
Choose Static website hosting, and then choose Use this bucket to host a website.
You are prompted to provide the index document and any optional error documents and redirection rules that are needed.
Make sure to keep your bucket ACL as public. Also you need to parse your jade files to 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

Using a visit counter for a site hosted in Amazon's AWS S3

I am hosting a website using Amazon S3 and Route 53 as part of their Amazon Web Services. The site is up and running fine but would like to be able to easily keep track of how many people visit the site?
I know you have resolved this, but I hope it will help someone else.
Below is a copy/paste from relevant page of AWS site made on Nov 18 (use this link to page for latest version) :
If you want to track the number of visitors who access your website, enable logging for the root domain bucket. Enabling logging is optional.
To enable logging for your root domain bucket
Open the Amazon S3 console at https://console.aws.amazon.com/s3/.
Create a bucket for logging named logs.example.com in the same AWS Region that the example.com and www.example.com buckets were created in.
Create two folders in the logs.example.com bucket; one named root, and the other named cdn. If you configure Amazon CloudFront to speed up your website, you will use the cdn folder.
In the Bucket name list, choose your root domain bucket, choose Properties, and then choose Server access logging.
Choose Enable logging.
For Target bucket, choose the bucket that you created for the log files, logs.example.com.
For Target prefix, type root/. This setting groups the log data files in the bucket in a folder named root so that they are easy to locate.
Choose Save.
You can now review your logs in the logs.example.com bucket, in both the root and cdn folders.
You can use any third-party counter in exactly the same way you would have it on non-S3 site. Do you experience any problem with any particular counter?

Host index.html in subfolders of S3 Bucket

Static website hosting is working in the root directory, but this is not working for me:
my.bucket/index.html
my.bucket/subfolder/index.html
https://s3-eu-west-1.amazonaws.com/my.bucket works as expected
https://s3-eu-west-1.amazonaws.com/my.bucket/subfolder doesn't work (Access Denied)
Is this possible?
There are (at least) three ways to access a static website hosted in AWS.
The S3 bucket name
The CDN name. (which is what the "host a static website" wizard tells you to use)
The "Static website hosting endpoint" which is listed on the S3 bucket management page
Only the "static website hosting endpoint" filters incoming requests to give Apache like behaviour; S3 is a RESTful API for storing files with no concept of subfolders.
If you have used the wizard, there is "Manage file in S3" in tiny text at the bottom left of the screen, which will open up the correct page in the console for you, then click the 'properties' button.
You need to modify the permissions of the sub-folder as well to make it publicly accessible.