This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setting-up-ec2.html
118 lines (95 loc) · 8.06 KB
/
setting-up-ec2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html data-bs-theme="dark">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<link rel="stylesheet" href="css/styles.css">
<title>1. EC2 configuration</title>
<link rel="stylesheet" href="css/sidebars.css">
</head>
<body>
<!-- This button is only shown when the sidebar is collapsed -->
<div id="show-sidebar-button" style="display: none;">
<img src="img/arrow-line-left-thin.svg" class="shadow-sm"></img>
</div>
<!-- SIDEBAR -->
<div class="main h-100">
<div id="collapsable-sidebar">
<div class="flex-shrink-0 p-3">
<a class="d-flex align-items-center justify-content-between pb-3 mb-3 gap-2 link-light text-decoration-none border-bottom">
<span class="fs-5 fw-semibold text-light text-nowrap">LAMP on AWS guide</span>
<button type="button" id="hide-sidebar-button" class="btn shadow-sm d-flex justify-content-center p-1 m-0 shadow-sm">
<img src="img/arrow-line-left-thin.svg" height="26px"></img>
</button>
</a>
<ul class="list-unstyled ps-0">
<li class="mb-1">
<button class="btn btn-toggle align-items-center rounded collapsed text-light" data-bs-toggle="collapse" data-bs-target="#aws-collapse" aria-expanded="true">
<div href="#" class="link-light fw-normal text-decoration-none">1. <a class="text-nowrap link-light fw-semibold text-decoration-none">Setting up an EC2 instance</a></div>
</button>
<div class="collapse show" id="aws-collapse">
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
<li><a href="setting-up-ec2.html#section-1.1" class="link-light rounded">1.1 Creating the instance</a></li>
<li><a href="setting-up-ec2.html#section-1.2" class="link-light rounded">1.2 Connecting via SSH</a></li>
</ul>
</div>
</li>
<li class="mb-1">
<button class="btn btn-toggle align-items-center rounded collapsed text-light" data-bs-toggle="collapse" data-bs-target="#docker-collapse" aria-expanded="true">
<div href="#" class="link-light fw-normal text-decoration-none">2. <a class="text-nowrap link-light fw-semibold text-decoration-none">Setting up LAMP</a></div>
</button>
<div class="collapse show" id="docker-collapse">
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
<li><a href="setting-up-lamp.html#section-2.1" class="link-light rounded">2.1 System configuration</a></li>
<li><a href="setting-up-lamp.html#section-2.2" class="link-light rounded">2.2 Creating the SSL certificate</a></li>
<li><a href="setting-up-lamp.html#section-2.3" class="link-light rounded">2.3 Creating the docker containers</a></li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<div class="side-divider" id="sidebar-divider"></div>
<!-- PAGE CONTENT -->
<div class="page-content overflow-auto flex-fill text-light m-2">
<h2>1. Setting up an EC2 instance</h2><hr>
<h4 id="section-1.1">1.1 Creating the instance</h4>
<p class="p-0 m-0 mb-1 mt-2">First, go to your AWS management console and look for the EC2 dashboard</p>
<img src="img/ec2-instance/ec2-search.png" class="img-fluid" alt="EC2 dashboard search">
<p class="p-0 m-0 mb-1 mt-3">Look for the Launch instance section and click on the "Launch instance" button</p>
<img src="img/ec2-instance/ec2-launch.png" class="img-fluid" alt="EC2 launch instance">
<p class="p-0 m-0 mb-1 mt-3">Now we need to configure the AWS instance settings, you can choose any name you'd like, for the purpose of this guide I'm going to call it "lamp-on-aws"</p>
<img src="img/ec2-instance/ec2-config-1.png" class="img-fluid" alt="EC2 config name">
<p class="p-0 m-0 mb-1 mt-3">For the image I'm going with <code>Ubuntu x64</code>. You could choose any other linux-based distro if you want i.e: Amazon Linux, but some packages that are going to be used later may be missing from the distro, so Ubuntu is recommended for this guide.</p>
<img src="img/ec2-instance/ec2-config-2.png" class="img-fluid" alt="EC2 config AMI">
<p class="p-0 m-0 mb-1 mt-3">The next section is going to ask you for an Instance type, you can choose anything here. Since I'm using the AWS Learner Lab I'm going with the Free tier eligible <code>t2.micro</code> instance type.</p>
<img src="img/ec2-instance/ec2-config-3.png" class="img-fluid" alt="EC2 config instance type">
<p class="p-0 m-0 mb-1 mt-3">Now you need to create a key pair for SSH authentication, click on "create new key pair". I'm going to use PuTTY so a .ppk key file is needed. Create the key and then download it to your machine.</p>
<img src="img/ec2-instance/ec2-config-5.png" class="img-fluid" alt="EC2 config instance type">
<p class="p-0 m-0 mb-1 mt-3">In the Network settings for the purpose of this guide we'll allow SSH, HTTPS and HTTP traffic from anywere, which usually is not recommended for security reasons</p>
<img src="img/ec2-instance/ec2-config-4.png" class="img-fluid" alt="EC2 config instance type">
<p class="p-0 m-0 mb-1 mt-3">The configuration is complete! Your instance will now be visible from the instances panel. You can click on the instance ID to see a summary of the instance containing data that we'll use later for the SSH connection.</p>
<img src="img/ec2-instance/ec2-config-6.png" class="img-fluid" alt="EC2 intance panel">
<hr>
<h4 id="section-1.2">1.2 Running & connecting via SSH (with PuTTY)</h4>
<p class="p-0 m-0 mb-1 mt-2">Open PuTTY and go into the <code>Connection/SSH/Auth/Credentials</code> section. Here you need to insert your private key for SSH authentication.</p>
<img src="img/ec2-instance/putty-1.png" class="img-fluid" alt="">
<p class="p-0 m-0 mb-1 mt-2">
Then open the <code>Session</code> section. Here you need to insert the public IPv4 of the EC2 instance that you can find in the Instance summary. The port for SSH is <code>22</code>.
Press the "Open" button to start the SSH connection.
</p>
<img src="img/ec2-instance/putty-2.png" class="img-fluid" alt="">
<p class="p-0 m-0 mb-1 mt-2">You will be asked for a login username, by default the Ubuntu AMI image uses <code>ubuntu</code> so enter that.</p>
<img src="img/ec2-instance/putty-3.png" class="img-fluid" alt="">
<hr>
<p class="p-0 m-0 mb-1 mt-2">You are now SSH'd into a computer somewhere else in the world, but it doesn't do anything cool yet. Go onto the next step to set-up a LAMP stack to create a webpage</p>
<a href="setting-up-lamp.html" class="btn-toggle rounded text-light flex-wrap text-decoration-none">2. Setting up LAMP</a>
</div>
</div>
<!-- Libraries -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<script src="libraries/jquery-3.6.3.js"></script>
<!-- Custom js -->
<script src="js/sidebar-collapser.js"></script>
</body>
</html>