本文介绍了Rails的部署在EC2上的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的一周,我一直在玩橡胶创业板似乎无法得到它的工作。我已经决定这将是更容易只是手动设置我的EC2实例。问题是,我不知道怎么办。谷歌一直没有一个福利局多少帮助的。有什么建议么?这真的是AP preciated。

For the past week, I've been playing with the Rubber gem and can't seem to get it to work. I've decided it would be easier just to manually set up my EC2 instance. The problem is that I don't know how. Google hasn't been much help for a newb either. Any suggestions? It really is appreciated.

推荐答案

当然。

  1. 创建一个AWS账号。

  1. Create a AWS account.

决定你想在什么地区,很多事情于本判决,但担心以后,只是做一个便宜的像俄勒冈州或地区。

Decided what region you want to be in. Lots of things go into this decision, but worry about it later and just do a cheap one like Oregon or East.

请确保你在正确的区域左上角。

Make sure you are in the correct region at the top left.

然后单击启动服务器。

在这一点上,你必须选择一个AMI。阿美族基本上是你希望在你启动服务器使用的模板。亚马逊给你一些,但也有一吨在社会上部分。我是一个CentOS的家伙,所以我通常会寻找一个CentOS AMI。 RightScale的做一些好的,所以你可以搜索其中的一个。请确保你选择的i386或x64取决于服务器所需的大小。有两种不同类型的AMI年代,EBS支持和S3的支持。真的是你应该EBS坚持,因为你有更多的自由,但也有原因,同时使用,超出这个答案的范围。寻找EBS,你可能会很好。 EBS是块存储。基本上它是可连接硬盘,它们为实例。因为一切都在云中是虚,并没有什么思想在物理意义上,你必须想办法了。所以,如果你想要更多的存储空间,你可以在以后附加一些EBS卷。但有一件事,S3支持的情况下,去拜拜,当你关闭它们。在EBS的会太多,如果你有删除终止标志设置,但EBS的人可以停止他们以及终止他们。

At this point you have to pick a AMI. An AMI is basically the template you want to use when you boot your server. Amazon gives you some, but there are a ton in the community section. I am a CentOS guy so I usually search for a CentOS AMI. RightScale makes some good ones so you can search for one of those. Make sure you pick i386 or x64 depending on the size of server you want. There are two distinct types of AMI's, EBS backed and S3 backed. Really you should stick with EBS because you have some more freedoms, but there are reasons to use both that are beyond the scope of this answer. Look for EBS and you probably will be good. EBS is the block storage. Basically it is attachable harddrives for your instances. Since everything in the cloud is "virtual" and nothing is thought of in a physical sense, you have to think that way too. So if you want more storage, you can attach some EBS volumes later. One thing though, S3 backed instances go bye bye when you shut them down. The EBS ones will too if you have the delete on termination flag set, but with EBS ones you can "Stop" them as well as "Terminate" them.

选择大小和可用区。该区域是如果你将要建立某种形式的冗余重要。就像如果我有一个主从设置与MySQL我把主人在一个区域和奴隶在其他情况下亚马逊是有分离到一个区域的麻烦。但对于这种通用的,不用担心。

Select the size and availability zone. The zone is important if you are going to be setting up some kind of redundancy. Like if I have a master slave setup with MySQL I would put the master in one zone and the slave in another in case Amazon was having troubles that were isolated to one zone. But for this general purpose, don't worry about it.

高级实例选项。刚刚离开这个独自一人最有可能是罚款。一些小东西在这里你可以像终止保护后设置。

Advanced Instance Options. Just leave all this alone most likely it is fine. Some of the small things here you can set later like termination protection.

命名。无论什么。

请一个SSH密钥。 Striaght前进。只有这样,才能登录到亚马逊的服务器会与你为它指定SSH密钥。没有用户名或密码。

Make a SSH key. Striaght forward. The only way to login to an Amazon server will be with the SSH key you assign it. There are no user names or passwords.

安全组。在这里,你可以得到绊倒,以及在这里和#5。但是,你应该建立一个通用安全组调用了foo或任何然后添加你想在它打开的端口开始。所以,如果你想ssh到它,我假设你做什么,然后打开22.如果你想使用它的网页再打开80和8080或什么的。但要小心。我通常会在以后更改我的SSH端口的东西是随机的。而不是把0.0.0.0/0它,我把我个人的知识产权。但是,如果你不在乎那么多只是把0.0.0.0/0并打开坏小子到世界各地。

Security Groups. This is where you could get tripped up, well here and #5. But you should start off with creating a general security group call foo or whatever then adding the ports you want open on it. So if you want to ssh into it, which I assume you do, then open 22. If you want to use it for web then open 80 and 8080 or whatever. But be careful. I usually change my SSH port later to something random. And instead of putting 0.0.0.0/0 on it, I put my personal ip. But if you don't care that much just put 0.0.0.0/0 and open that bad boy to the world.

然后,它会启动。只要一切顺利,因为它应该。

Then it will boot. As long as it all went as it was supposed to.

现在你可以登录。只是SSH -i thekey.pem thenwholehostname

Now you can login. Just ssh -i thekey.pem thenwholehostname

希望有所帮助。

有这整个自由层可以使用。 http://aws.amazon.com/free/

There is this whole free tier you can use. http://aws.amazon.com/free/

检查出来。我会用,当你用它玩了。

Check that out. I would use that while you play with it.

我所做的一切,从内存,所以我可能已经关闭。 ;)

I did all that from memory so I could have been off. ;)

这篇关于Rails的部署在EC2上的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 01:53
查看更多