mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
translated
This commit is contained in:
parent
32d688c3af
commit
a9e7f498c6
@ -1,146 +0,0 @@
|
||||
translating---geekpi
|
||||
|
||||
How to setup a Linux server on Amazon AWS
|
||||
============================================================
|
||||
|
||||
### On this page
|
||||
|
||||
1. [Setup a Linux VM in AWS][1]
|
||||
2. [Connect to an EC2 instance from Windows][2]
|
||||
|
||||
AWS (Amazon Web Services) is one of the leading cloud server providers worldwide. You can setup a server within a minute using the AWS platform. On AWS, you can fine tune many techncal details of your server like the number of CPU's, Memory and HDD space, type of HDD (SSD which is faster or a classic IDE) and so on. And the best thing about the AWS is that you need to pay only for the services that you have used. To get started, AWS provides a special account called "Free tier" where you can use the AWS technology free for one year with some minor restrictions like you can use the server only upto 750 Hours a month, when you cross this theshold they will charge you. You can check all the rules related this on [aws portal][3].
|
||||
|
||||
Since I am writing this post about creating a Linux server on AWS, having a "Free Tier" account is the main pre-requisite. To sign up for this account you can use this [link][4]. Kindly note that you need to enter your credit card details while creating the account.
|
||||
|
||||
So let's assume that you have created the "free tier" account.
|
||||
|
||||
Before we proceed, you must know some of the terminologies in AWS to understand the setup:
|
||||
|
||||
1. EC2 (Elastic compute cloud): This term used for the virtual machine.
|
||||
2. AMI (Amazon machine image): Used for the OS instance.
|
||||
3. EBS (Elastic block storage): one of the type Storage environment in AWS.
|
||||
|
||||
Now login to AWS console at below location:
|
||||
|
||||
[https://console.aws.amazon.com/][5]
|
||||
|
||||
The AWS console will look like this:
|
||||
|
||||
[
|
||||
![Amazon AWS console](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_console.JPG)
|
||||
][6]
|
||||
|
||||
### Setup a Linux VM in AWS
|
||||
|
||||
1: Create an EC2 (virtual machine) instance: Before installing the OS on you must create a VM in AWS. To create this, click on EC2 under compute menu:
|
||||
|
||||
[
|
||||
![Create an EC2 instance](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_console_ec21.png)
|
||||
][7]
|
||||
|
||||
2\. Now click on "Launch Instance" Button under Create instance.
|
||||
|
||||
[
|
||||
![Launch the EC2 instance](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_launch_ec2.png)
|
||||
][8]
|
||||
|
||||
3\. Now, when you are using a free tier account, then better select the Free Tier radio button so that AWS will filter the instances which are used for free usage. This will keep you aside from paying money to AWS for using billed resources under AWS.
|
||||
|
||||
[
|
||||
![Select Free Tier instances only](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_free_tier_radio1.png)
|
||||
][9]
|
||||
|
||||
4\. To proceed further, select following options:
|
||||
|
||||
a. **Choose an AMI in the classic instance wizard: selection --> I'll use Red Hat Enterprise Linux 7.2 (HVM), SSD Volume Type here**
|
||||
|
||||
b. Select "**t2.micro**" for the instance details.
|
||||
|
||||
c. **Configure Instance Details**: Do not change anything simply click next.
|
||||
|
||||
d. **Add Storage: **Do not change anything simply click next as we will using default Size 10 (GiB) Hard disk in this case.
|
||||
|
||||
e. **Add Tags**: Do not change anything simply click next.
|
||||
|
||||
f. **Configure Security Group**: Now select port 22 which is used for ssh so that you can access this server from anywhere.
|
||||
|
||||
[
|
||||
![Configure AWS server](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_ssh_port1.png)
|
||||
][10]
|
||||
|
||||
g. **Select review and launch button**
|
||||
|
||||
h. If all the details are Ok now press the "**Launch**" button,
|
||||
|
||||
i. Once you clicked the Launch button, a popup window gets displayed to create a "Key pair" as shown below: Select the option "create a new key pair" and give a name to key pair. Then download the same. You require this key pair while connecting to the server using ssh. At the end, click the "Launch Instance" button.
|
||||
|
||||
[
|
||||
![Create Key pair](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_key_pair.png)
|
||||
][11]
|
||||
|
||||
j. After clicking Launch instance Button, go to services at the left top side. Select Compute--> EC2\. Now click on running instance link as below:
|
||||
|
||||
[
|
||||
![Go to the running EC2 instance](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_running_instance.png)
|
||||
][12]
|
||||
|
||||
k. Now you can see that your new VM is ready with status "running" as shown below. Select the Instance and Please note down the "Public DNS value" which is required for logging on to the server.
|
||||
|
||||
[
|
||||
![Public DNS value of the VM](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_dns_value.png)
|
||||
][13]
|
||||
|
||||
Now you are done with creating a sample Linux installed VM. To connect to the server, follow below steps.
|
||||
|
||||
### Connect to an EC2 instance from Windows
|
||||
|
||||
1\. First of all, you need to have putty gen and Putty exe's for connecting to the server from Windows (or the SSH command on Linux). You can download putty by following this [Link][14].
|
||||
|
||||
2\. Now open the putty gen "puttygen.exe".
|
||||
|
||||
3\. You need to click on the "Load button", browse and select the keypair file (pem file) that you downloaded above from Amazon.
|
||||
|
||||
4\. You need to select the "ssh2-RSA" option and click on the save private key button. Kindly select yes on the next pop-up.
|
||||
|
||||
5\. Save the file with the file extension .ppk.
|
||||
|
||||
6\. Now you need to open Putty.exe. Go to connection at the left side menu then select "SSH" and then select "Auth". You need to click on the browse button to select the .ppk file that we created in the step 4.
|
||||
|
||||
7\. Now click on the "session" menu and paste the DNS value captured during the 'k' step of this tutorial in the "host name" box and hit the open button.
|
||||
|
||||
8\. Upon asking for username and password, enter "**ec2-user**" and blank password and then give below command.
|
||||
|
||||
$sudo su -
|
||||
|
||||
Hurray, you are now root on the Linux server which is hosted on AWS cloud.
|
||||
|
||||
[
|
||||
![Logged in to AWS EC2 server](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_putty1.JPG)
|
||||
][15]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/
|
||||
|
||||
作者:[MANMOHAN MIRKAR][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/
|
||||
[1]:https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/#setup-a-linux-vm-in-aws
|
||||
[2]:https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/#connect-to-an-ec-instance-from-windows
|
||||
[3]:http://aws.amazon.com/free/
|
||||
[4]:http://aws.amazon.com/ec2/
|
||||
[5]:https://console.aws.amazon.com/
|
||||
[6]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_console.JPG
|
||||
[7]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_console_ec21.png
|
||||
[8]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_launch_ec2.png
|
||||
[9]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_free_tier_radio1.png
|
||||
[10]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_ssh_port1.png
|
||||
[11]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_key_pair.png
|
||||
[12]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_running_instance.png
|
||||
[13]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_dns_value.png
|
||||
[14]:http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
|
||||
[15]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_putty1.JPG
|
@ -0,0 +1,145 @@
|
||||
如何在 Amazon AWS 上设置一台 Linux 服务器
|
||||
============================================================
|
||||
|
||||
### 在本篇中
|
||||
|
||||
1. [在 AWS 中设置一台 Linux VM][1]
|
||||
2. [在 Windows 中连接到 EC2 实例][2]
|
||||
|
||||
AWS(Amazon Web Services)是全球领先的云服务器提供商之一。你可以在 AWS 平台上在一分钟内设置完服务器。在 AWS 上,你可以微调服务器的许多技术细节,如 CPU 数量,内存和磁盘空间,磁盘类型(更快的 SSD 或者经典的 IDE)等。关于 AWS 最好的一点是,你只需要为你使用的服务付费。在开始之前,AWS 提供了一个名为 “Free Tier” 的特殊帐户,你免费使用一年的 AWS 技术服务,但会有一些小限制,例如,你只能每个月使用服务器时长 750 小时,超过这个他们就会向你收费。你可以在[ aws 官网][3]上查看所有相关的规则。
|
||||
|
||||
因为我的这篇文章是关于在 AWS 上创建 Linux 服务器,因此拥有 “Free Tier” 帐户是先决条件。要注册帐户,你可以使用此[链接][4]。请注意,你需要在创建帐户时输入信用卡详细信息。
|
||||
|
||||
让我们假设你已经创建了 “Free Tier” 帐户。
|
||||
|
||||
在继续之前,你必须了解 AWS 中的一些术语以了解设置:
|
||||
|
||||
1. EC2(弹性计算云):此术语表示虚拟机。
|
||||
2. AMI(Amazon 机器镜像):表示操作系统实例。
|
||||
3. EBS(弹性块存储):AWS 中的一种存储环境类型。
|
||||
|
||||
通过以下链接登录 AWS 控制台:
|
||||
|
||||
[https://console.aws.amazon.com/][5]
|
||||
|
||||
AWS 控制台将如下所示:
|
||||
|
||||
[
|
||||
![Amazon AWS console](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_console.JPG)
|
||||
][6]
|
||||
|
||||
### 在 AWS 中设置 Linux VM
|
||||
|
||||
1\. 创建一个 EC2(虚拟机)实例:在开始安装系统之前,你必须在 AWS 中创建一台虚拟机。要创建虚拟机,在计算菜单下点击 EC2:
|
||||
|
||||
[
|
||||
![Create an EC2 instance](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_console_ec21.png)
|
||||
][7]
|
||||
|
||||
2\. 现在在创建实例下点击 “Launch Instance” 按钮。
|
||||
|
||||
[
|
||||
![Launch the EC2 instance](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_launch_ec2.png)
|
||||
][8]
|
||||
|
||||
3\. 现在,当你使用的是一个 “Free Tier” 帐号,接着最好选择 “Free Tier” 单选按钮以便 AWS 可以过滤出可以免费使用的实例。这可以让你不用为使用 AWS 的资源而付费。
|
||||
|
||||
[
|
||||
![Select Free Tier instances only](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_free_tier_radio1.png)
|
||||
][9]
|
||||
|
||||
4\. 要继续操作,请选择以下选项:
|
||||
|
||||
a\. **在经典实例向导中选择一个 AMI:selection - >我将使用 Red Hat Enterprise Linux 7.2(HVM),SSD 存储 **
|
||||
|
||||
b\. 选择 “**t2.micro**” 作为实例详细信息。
|
||||
|
||||
c\. **配置实例详细信息**:不要更改任何内容,只需单击下一步。
|
||||
|
||||
d\. **添加存储**:不要更改任何内容,只需点击下一步,因为此时我们将使用默认的 10(GiB)硬盘。
|
||||
|
||||
e\. **添加标签**:不要更改任何内容只需点击下一步。
|
||||
|
||||
f\. **配置安全组**:现在选择用于 ssh 的 22 端口,以便你可以在任何地方访问此服务器。
|
||||
|
||||
[
|
||||
![Configure AWS server](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_ssh_port1.png)
|
||||
][10]
|
||||
|
||||
g\. **选择查看并启动按钮**
|
||||
|
||||
h\. 如果所有的细节都完成了,现在点击 “**Launch**” 按钮。
|
||||
|
||||
i\. 单击启动按钮后,系统会像下面那样弹出一个窗口显示创建“密钥对”:选择选项 “create a new key pair”,并给密钥对起个名字。接下来下载下来。在使用 ssh 连接到服务器时,需要此密钥对。最后,单击 “Launch Instance” 按钮。
|
||||
|
||||
[
|
||||
![Create Key pair](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_key_pair.png)
|
||||
][11]
|
||||
|
||||
j\. 点击启动实例按钮后,转到左上角的服务。选择 “Compute--> EC2”。现在点击运行实例:
|
||||
|
||||
[
|
||||
![Go to the running EC2 instance](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_running_instance.png)
|
||||
][12]
|
||||
|
||||
k\. 现在你可以看到,你的新 VM 的状态是 “running”。选择实例,请记下登录到服务器所需的 “Public DNS value”。
|
||||
|
||||
[
|
||||
![Public DNS value of the VM](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_dns_value.png)
|
||||
][13]
|
||||
|
||||
现在你已完成创建一台运行 Linux 的 VM。要连接到服务器,请按照以下步骤操作。
|
||||
|
||||
|
||||
### 从 Windows 中连接到 EC2 实例
|
||||
|
||||
1\. 首先,你需要有 putty gen 和 Putty exe 用于从 Windows 连接到服务器(或 Linux 上的 SSH 命令)。你可以通过下面的[链接][14]下载 putty。
|
||||
|
||||
2\. 现在打开 putty gen “puttygen.exe”。
|
||||
|
||||
3\. 你需要单击 “Load” 按钮,浏览并选择你从亚马逊上面下载的密钥对文件(pem文件)。
|
||||
|
||||
4\. 你需要选择 “ssh2-RSA” 选项,然后单击保存私钥按钮。请在下一个弹出窗口中选择 yes。
|
||||
|
||||
5\. 保存扩展名为 .ppk 的文件。
|
||||
|
||||
6\. 现在你需要打开 putty.exe。在左侧菜单中点击 “connect”,然后选择 “SSH”,然后选择 “Auth”。你需要单击浏览按钮来选择我们在步骤 4 中创建的 .ppk 文件。
|
||||
|
||||
7\. 现在点击 “session” 菜单,并在“host name” 中粘贴在本教程中 “k” 步骤中的 DNS 值,然后点击 “open” 按钮。
|
||||
|
||||
8\. 在要求用户名和密码时,输入 “**ec2-user**” 和空白密码,然后输入下面的命令。
|
||||
|
||||
$ sudo su -
|
||||
|
||||
哈哈,你现在是在 AWS 云上托管的 Linux 服务器上的主人啦。
|
||||
|
||||
[
|
||||
![Logged in to AWS EC2 server](https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/aws_putty1.JPG)
|
||||
][15]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/
|
||||
|
||||
作者:[MANMOHAN MIRKAR][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/
|
||||
[1]:https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/#setup-a-linux-vm-in-aws
|
||||
[2]:https://www.howtoforge.com/tutorial/how-to-setup-linux-server-with-aws/#connect-to-an-ec-instance-from-windows
|
||||
[3]:http://aws.amazon.com/free/
|
||||
[4]:http://aws.amazon.com/ec2/
|
||||
[5]:https://console.aws.amazon.com/
|
||||
[6]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_console.JPG
|
||||
[7]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_console_ec21.png
|
||||
[8]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_launch_ec2.png
|
||||
[9]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_free_tier_radio1.png
|
||||
[10]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_ssh_port1.png
|
||||
[11]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_key_pair.png
|
||||
[12]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_running_instance.png
|
||||
[13]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_dns_value.png
|
||||
[14]:http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
|
||||
[15]:https://www.howtoforge.com/images/how_to_setup_linux_server_with_aws/big/aws_putty1.JPG
|
Loading…
Reference in New Issue
Block a user