cloudfront s3_如何使用S3,CloudFront和Route53托管静态网站

cloudfront s3

by Paul Berg

保罗·伯格

如何使用S3,CloudFront和Route53托管静态网站 (How to Host a Static Website with S3, CloudFront and Route53)

I recently set-up my self-hosted personal blog and I underestimated the effort I had to put in to make it exactly as I wanted. So I decided to write a tutorial to help others do it with less overhead.

我最近建立了自我托管的个人博客 ,但我低估了为使其完全符合我的意愿而付出的努力。 因此,我决定编写一个教程来帮助其他人以更少的开销来完成它。

This article will go into fine details on how to tick all the boxes below, with a focus on the backend components.

本文将详细介绍如何在下面的所有方框中打勾,重点是后端组件。

  1. Pay-as-you-go hosting

    即付即用托管
  2. SSL certificate

    SSL证书
  3. Functional www subdomain

    功能www子域
  4. Highly customisable but minimalistic design

    高度可定制但简约的设计
  5. Markdown-powered articles

    Markdown支持的文章

For 4 and 5 above, I used Hugo with the Minimal theme.

对于上面的4和5,我将HugoMinimal主题结合使用。

警告 (Caveat)

Do note that this is a verbose tutorial, aimed at those who value flexibility and interoperability with other AWS services more than anything else. If you’re just looking for something light and quick, you may want to use Netlify or Amplify.

请注意,这是一个冗长的教程,针对的是那些最重视与其他AWS服务的灵活性和互操作性的人。 如果您只是想寻找轻便快捷的产品,则可以使用NetlifyAmplify

先决条件 (Prerequisites)

I will further assume that:

我将进一步假设:

  1. You designed and coded your website or at least have a mockup.

    您设计并编写了网站代码,或者至少有一个模型。
  2. You have an AWS account (if not, go register one. AWS Accounts include one year of free tier access).

    您有一个AWS帐户(如果没有,请注册一个 。AWS帐户包括一年的免费套餐访问权限)。

  3. You are familiar with DNS and how it works, at least at a high level.

    您至少在较高级别上熟悉DNS及其工作原理

Regarding DNS, a quick explanation is that it’s sort of the directory of the Internet and, just like Google owns google.com, you can own your own domain such as example.com as well. To do it, you have to go a DNS registrar and purchase your the domain you want. I strongly recommend using Namecheap as your registrar, as they have an awesome UI and low prices. As an alternative, you could choose GoDaddy.

关于DNS,一个快速的解释是它是Internet的目录,就像Google拥有google.com ,您也可以拥有自己的域,例如example.com 。 为此,您必须先进行DNS注册,然后购买所需的域名。 我强烈建议使用Namecheap作为您的注册商,因为它们的UI很棒而且价格低廉。 或者,您可以选择GoDaddy

In case your “.com” domain is taken and you want some clever mashups, the following sites would be helpful:

如果您的“ .com”域名已被占用,并且想要一些巧妙的混搭,则以下站点会有所帮助:

After you purchase it, don’t set any DNS records yet. We’ll do that later once we get to Route53.

购买后,请不要设置任何DNS记录。 一旦到达Route53,我们将在稍后进行。

使用Amazon AWS托管 (Hosting with Amazon AWS)

As mentioned above, the goal is to use a pay-as-you-go service because it’s by far the most cost-effective option out there. I used to pay a fixed cost in the range of tens of USD per month for a server even if I had periods when there was hardly any activity on it.

如上所述,我们的目标是使用即付即用服务,因为它是目前为止最具成本效益的选择。 我曾经为服务器支付每月几十美元的固定成本,即使我几乎没有活动的时间。

However, from my experience, I would recommend that you go modular and go with a p

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值