简体   繁体   English

Domain + AWS EC2:如何让www.mydomain.com指向我的EC2服务器?

[英]Domain + AWS EC2: How to make www.mydomain.com point to my EC2 server?

I'm trying to create a website and I just bought a domain at domain.com. 我正在尝试创建一个网站,我刚刚在domain.com上购买了一个域名。 I also launched an EC2 instance in AWS. 我还在AWS中启动了一个EC2实例。 Which one of the options would I choose below so that going to www.edmundscoolsite.com would point to my EC2 instance? 我将在下面选择哪一个选项,以便访问www.edmundscoolsite.com指向我的EC2实例?

在此输入图像描述

There are actually a couple of options here. 这里有几个选项。

The best option is to associate an elastic IP address with your EC2 instance, then use an A record. 最好的选择是将弹性IP地址与EC2实例相关联,然后使用A记录。 The EIP is yours until you release it, even if you replace your instance. EIP是你的,直到你发布它,即使你更换你的实例。

An alternative option is to make www.edmundscoolsite.com a CNAME record whose value is the public DNS for your EC2 instance, something like ec2-1-2-3-4.us-west-2.compute.amazonaws.com . 另一种选择是让www.edmundscoolsite.com成为CNAME记录,其值为EC2实例的公共DNS,类似于ec2-1-2-3-4.us-west-2.compute.amazonaws.com When you replace your EC2 instance the CNAME will no longer be valid, however, which is why the first option is better. 当您替换EC2实例时,CNAME将不再有效,这就是为什么第一个选项更好。

In order to point www.edmundscoolsite.com to your EC2 instance, you can add a CNAME or A record. 为了将www.edmundscoolsite.com指向您的EC2实例,您可以添加CNAME或A记录。

more here : https://forums.aws.amazon.com/thread.jspa?threadID=87279 更多信息: https//forums.aws.amazon.com/thread.jspa?threadID = 87279

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM