Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
331 views
in Technique[技术] by (71.8m points)

javascript - AWS-输入域网址时没有此类存储桶错误(AWS - No such bucket error when entering domain url)

I have deployed a Node app onto an Amazon EC2 instance.(我已将Node应用程序部署到Amazon EC2实例上。)

I then tried to point my domain to this instance.(然后,我尝试将我的域指向该实例。) I followed the guide at http://docs.aws.amazon.com/gettingstarted/latest/swh/getting-started-configure-route53.html .(我遵循了http://docs.aws.amazon.com/gettingstarted/latest/swh/getting-started-configure-route53.html上的指南。)

I created a hosted zone, entering mydomain.com.(我创建了一个托管区域,输入mydomain.com。)

I then created record sets for the domain and subdomain.(然后,我为域和子域创建记录集。)

When creating the record for the doman, I entered the following details:(在为杜曼创建记录时,我输入了以下详细信息:)

  • For Type I choose "A — IPv4 address"(对于类型I,选择“ A-IPv4地址”)
  • For Alias I choose "Yes".(对于“别名”,我选择“是”。)
  • For Alias Target the guide says "choose your root domain website endpoint from the list (for example, example.com)".(对于Alias Target,指南说:“从列表中选择您的根域网站终结点(例如example.com)”。) However, for me, the dropdown did not have my domain.(但是,对我而言,下拉列表没有我的域名。) It only had "No Targets Available".(它只有“没有可用目标”。) I searched some forums and many people had this issue and the advice was to enter "s3-website-eu-west-1.amazonaws.com" which I did.(我搜索了一些论坛,许多人遇到了这个问题,建议您输入“ s3-website-eu-west-1.amazonaws.com”。)

I did the same for subdomain, again entering "s3-website-eu-west-1.amazonaws.com".(我对子域也一样,再次输入“ s3-website-eu-west-1.amazonaws.com”。)

I then went to the service where I bought the domain name and entered the name servers.(然后,我去了我购买域名并输入名称服务器的服务。)

However, when i go to my URL, I get:(但是,当我转到URL时,会得到:)

Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: mydomain.com
RequestId: 656B653A2ED5B2B1
HostId: 9etNAX1XEJmbVKUAMylBDz3xEky+7RhAnr9b8HhpkIb9+pkMnn920v/MSAUjr78oyONEUdlba50=

Any Ideas what Im doing wrong?(任何想法我在做什么错?)

  ask by Mark translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you're using EC2, you have to configure Route53 to point to the EC2, not S3.(如果使用的是EC2,则必须将Route53配置为指向EC2,而不是S3。)

S3 is for static web hosting, EC2 for dynamic .(S3用于static虚拟主机,EC2用于dynamic虚拟主机。) With that said, I would highly recommend switching to EBS, it is significantly easier to point your domain to an EBS destination, otherwise there's a bit more set up.(话虽如此,我强烈建议您切换到EBS,将您的域指向EBS目的地要容易得多,否则需要进行更多设置。) For Route53 to EC2:(对于Route53到EC2:)
  1. Navigate to EC2 and hit Elastic IP(导航到EC2并点击Elastic IP)
  2. Register a new Elastic IP address(注册一个新的弹性IP地址)
  3. Associate this address with your instance(将此地址与您的实例相关联)
  4. Go to instances and you should see a blue IP address hyperlink instead of a black one(转到实例,您应该看到一个蓝色的IP地址超链接,而不是一个黑色的超链接。)
  5. Go back to Route53 > hosted zones > you're domain(返回Route53>托管区域>您是域)
  6. Create a resource record set in your hosted zone.(在您的托管区域中创建资源记录集。)
  7. Choose Type A – Ipv4 address.(选择Type A – Ipv4地址。)
  8. For Value, specify the Elastic IP address for your Amazon EC2 instance.(对于值,为您的Amazon EC2实例指定弹性IP地址。)

Another thing, if you are using a third party vendor, all you have to do is put in the NS record (to match your Route53 ones) and the Elastic IP in the providers site.(另一件事,如果您使用的是第三方供应商,那么您要做的全部工作就是将NS记录(与Route53的记录匹配)和提供者站点中的Elastic IP放入。)

(And I would recommend swapping it to AWS, so much easier)((而且我建议将其交换到AWS,这样容易得多))

Update(更新资料)

@Mark also had port connection issues:(@Mark也有端口连接问题:)

  1. Navigate your app.js file OR ./bin/www (if you're using express ) and change the listening port to 80 .(浏览您的app.js文件或./bin/www (如果使用express ),然后将侦听端口更改为80 。)
  2. Check your instances security group to make sure it says incoming access: HTTP Port: 80(检查您的实例安全组以确保其显示incoming access: HTTP Port: 80)

This is a common mistake because developing locally does not like when you use port 80. Hence the frequent default to 3000 , 8080 , etc.(这是一个常见的错误,因为本地开发时不使用端口80因此,频繁的默认像30008080 ,等等。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...