1 00:00:00,090 --> 00:00:01,560 In this lesson, I'm going to show you 2 00:00:01,560 --> 00:00:03,030 how to use the cloud 3 00:00:03,030 --> 00:00:05,460 and we're going to do this by using a product from Amazon 4 00:00:05,460 --> 00:00:06,960 known as Lightsail. 5 00:00:06,960 --> 00:00:10,170 Now Lightsail is Amazon's entry to the cloud product. 6 00:00:10,170 --> 00:00:13,170 Instead of having to use EC2, which is for compute; 7 00:00:13,170 --> 00:00:15,120 Route 53, which is for networking; 8 00:00:15,120 --> 00:00:17,040 Aurora, which is for databases; 9 00:00:17,040 --> 00:00:18,990 Fargate, which is for containers 10 00:00:18,990 --> 00:00:20,940 and S3, which is for storage, 11 00:00:20,940 --> 00:00:22,590 we actually get all of that combined 12 00:00:22,590 --> 00:00:25,080 into one nice easy to use package 13 00:00:25,080 --> 00:00:27,510 for us as beginners in the cloud. 14 00:00:27,510 --> 00:00:29,160 Now the first thing you're going to want to do is 15 00:00:29,160 --> 00:00:31,080 get yourself an Amazon account 16 00:00:31,080 --> 00:00:35,430 by going to aws.amazon.com/Lightsail. 17 00:00:35,430 --> 00:00:38,070 From here, you can click on create an AWS account 18 00:00:38,070 --> 00:00:40,320 and sign up for one for free. 19 00:00:40,320 --> 00:00:42,360 Once you do that, you'll be able to log into your account 20 00:00:42,360 --> 00:00:44,370 and get to your Lightsail dashboard. 21 00:00:44,370 --> 00:00:47,223 From here, you're going to click on Create an instance. 22 00:00:48,180 --> 00:00:50,640 Once you do that, you're then going to select the region 23 00:00:50,640 --> 00:00:53,370 and availability zone that's closest to you. 24 00:00:53,370 --> 00:00:56,730 If you want to change that, simply click on change AWS region 25 00:00:56,730 --> 00:00:59,820 and you can choose from any location around the world. 26 00:00:59,820 --> 00:01:01,860 In my case, I'm closest to the east side 27 00:01:01,860 --> 00:01:04,560 of the United States, so I'm going to choose either Virginia 28 00:01:04,560 --> 00:01:07,800 or Ohio for US East 1 or US East 2, 29 00:01:07,800 --> 00:01:10,770 and I'm going to go ahead and use US East 1 with Virginia 30 00:01:10,770 --> 00:01:12,240 because it's a little bit closer to me 31 00:01:12,240 --> 00:01:14,460 and it'll help reduce my load times. 32 00:01:14,460 --> 00:01:17,430 Now as you scroll down, you can then pick your platform. 33 00:01:17,430 --> 00:01:19,350 You have a choice between Linux and Unix 34 00:01:19,350 --> 00:01:21,480 or Microsoft Windows. 35 00:01:21,480 --> 00:01:24,600 Do be aware that Linux and Unix is cheaper on Lightsail 36 00:01:24,600 --> 00:01:27,630 than Microsoft Windows, and this is because Linux and Unix 37 00:01:27,630 --> 00:01:29,490 is an open source piece of software, 38 00:01:29,490 --> 00:01:31,440 so there's no licensing cost. 39 00:01:31,440 --> 00:01:33,870 For example, you can start out with the lowest plan 40 00:01:33,870 --> 00:01:37,140 on Linux or Unix for only $3 and 50 cents per month, 41 00:01:37,140 --> 00:01:39,930 which gives you your server and all of your configurations. 42 00:01:39,930 --> 00:01:40,950 Whereas with Microsoft, 43 00:01:40,950 --> 00:01:44,040 it is going to start out at $8 per month for the lowest level 44 00:01:44,040 --> 00:01:45,750 because there is licensing associated 45 00:01:45,750 --> 00:01:47,610 with that server software. 46 00:01:47,610 --> 00:01:49,620 I'm going to recommend that you use Linux or Unix 47 00:01:49,620 --> 00:01:51,930 as your blueprint, and the reason for this is 48 00:01:51,930 --> 00:01:54,090 when you get into core two of A+, 49 00:01:54,090 --> 00:01:55,440 you actually have to get comfortable 50 00:01:55,440 --> 00:01:57,150 using some commands in Linux. 51 00:01:57,150 --> 00:01:59,280 And so by creating this here in the cloud 52 00:01:59,280 --> 00:02:01,110 while you're studying for the next couple of months, 53 00:02:01,110 --> 00:02:03,720 you can go back, log into your Linux server in the cloud 54 00:02:03,720 --> 00:02:05,910 and use that to practice with. 55 00:02:05,910 --> 00:02:08,220 Next we're going to choose what we want. 56 00:02:08,220 --> 00:02:12,390 Do we want an application and OS or do we want the OS only? 57 00:02:12,390 --> 00:02:14,400 Essentially, what this is asking is 58 00:02:14,400 --> 00:02:16,290 do I want platform as a service 59 00:02:16,290 --> 00:02:18,300 or infrastructure as a service? 60 00:02:18,300 --> 00:02:19,830 Now if I do OS only, 61 00:02:19,830 --> 00:02:22,740 I can choose the exact version of Linux I want to use, 62 00:02:22,740 --> 00:02:24,810 whether that is Amazon's own version of Linux 63 00:02:24,810 --> 00:02:29,190 referred to as AMI or Amazon Linux two or Ubuntu, 64 00:02:29,190 --> 00:02:32,583 Debian, FreeBSD, openSUSE or CentOS. 65 00:02:33,540 --> 00:02:36,690 If I want to use an App + OS, this is going to give me 66 00:02:36,690 --> 00:02:38,910 not just the underlying operating system, 67 00:02:38,910 --> 00:02:41,460 but it's also going to give me some application. 68 00:02:41,460 --> 00:02:43,740 For example, if you want to create your own website 69 00:02:43,740 --> 00:02:46,050 using a WordPress log, you could do that 70 00:02:46,050 --> 00:02:48,600 by selecting WordPress here as the app 71 00:02:48,600 --> 00:02:51,360 or maybe you want to create your own internal community 72 00:02:51,360 --> 00:02:54,060 and you're going to use Joomla or Drupal to do that, 73 00:02:54,060 --> 00:02:55,650 or maybe you're going to start writing 74 00:02:55,650 --> 00:02:57,480 your own custom application 75 00:02:57,480 --> 00:02:59,910 and so you want to have Node.js installed 76 00:02:59,910 --> 00:03:01,500 that way you have that as the baseline 77 00:03:01,500 --> 00:03:02,850 and everything else you're going to code 78 00:03:02,850 --> 00:03:05,220 is going to be written in Node.js. 79 00:03:05,220 --> 00:03:07,140 By offering this App + OS, 80 00:03:07,140 --> 00:03:08,700 this allows us to take the hard work 81 00:03:08,700 --> 00:03:10,590 out of configuring those applications 82 00:03:10,590 --> 00:03:12,540 as opposed to getting just the operating system 83 00:03:12,540 --> 00:03:15,660 and then having to install those applications ourself later. 84 00:03:15,660 --> 00:03:18,330 In my case, I'm going to choose CentOS down here 85 00:03:18,330 --> 00:03:21,180 in the bottom right because CentOS is a Red Hat 86 00:03:21,180 --> 00:03:23,880 based version of Linux and most organizations, 87 00:03:23,880 --> 00:03:25,710 if they're running their own Linux servers 88 00:03:25,710 --> 00:03:29,640 are using either Red Hat Enterprise Linux or CentOS 89 00:03:29,640 --> 00:03:31,350 and for that reason if you decide 90 00:03:31,350 --> 00:03:33,930 to move up into the CompTIA Linux+ course, 91 00:03:33,930 --> 00:03:36,600 you'll be using CentOS as the base operating system 92 00:03:36,600 --> 00:03:38,460 as you go throughout that course as well. 93 00:03:38,460 --> 00:03:41,310 So it's a good one for us to choose here. 94 00:03:41,310 --> 00:03:42,960 Then we're going to scroll down 95 00:03:42,960 --> 00:03:45,390 and we are going to have some other options we can configure, 96 00:03:45,390 --> 00:03:47,220 including if we want a script 97 00:03:47,220 --> 00:03:49,680 that will launch every time we load up this server 98 00:03:49,680 --> 00:03:52,590 or being able to create a unique SSH key pair 99 00:03:52,590 --> 00:03:54,570 to remotely log into this machine. 100 00:03:54,570 --> 00:03:57,420 For right now, I'm going to stick with the defaults on this 101 00:03:57,420 --> 00:03:59,190 and then as we scroll to the bottom, 102 00:03:59,190 --> 00:04:01,770 you can see we have to choose our plan. 103 00:04:01,770 --> 00:04:04,050 Now as I said with the Linux option, 104 00:04:04,050 --> 00:04:05,910 we can start out at the lowest plan, 105 00:04:05,910 --> 00:04:08,400 which is $3 and 50 cents per month. 106 00:04:08,400 --> 00:04:11,280 And with Amazon they're running a special right now 107 00:04:11,280 --> 00:04:12,450 where if you sign up, 108 00:04:12,450 --> 00:04:14,460 you're going to get your first three months free 109 00:04:14,460 --> 00:04:17,880 and there is no contract so we can actually sign up, 110 00:04:17,880 --> 00:04:19,829 it'll be free for the first three months 111 00:04:19,829 --> 00:04:21,450 and so we're going to be able to play with this 112 00:04:21,450 --> 00:04:23,610 and then if you delete it by the end of that three months, 113 00:04:23,610 --> 00:04:25,530 you won't be charged anything. 114 00:04:25,530 --> 00:04:27,510 Now when you're picking out your server, 115 00:04:27,510 --> 00:04:30,120 you're going to figure out what equipment you want 116 00:04:30,120 --> 00:04:32,070 and based on that you're going to pay more 117 00:04:32,070 --> 00:04:33,690 or less money per month. 118 00:04:33,690 --> 00:04:35,820 As I said, Amazon is running a special 119 00:04:35,820 --> 00:04:38,280 at the time of this recording where you can get 120 00:04:38,280 --> 00:04:41,790 any of the first three level plans for free for three months 121 00:04:41,790 --> 00:04:44,400 and then after that you would pay the price listed here 122 00:04:44,400 --> 00:04:45,360 on the screen. 123 00:04:45,360 --> 00:04:47,310 So, since I'm planning on only using this 124 00:04:47,310 --> 00:04:49,560 for the next two or three months, I'm going to go ahead 125 00:04:49,560 --> 00:04:51,330 and select the $10 version 126 00:04:51,330 --> 00:04:53,850 because this is going to gimme more memory and storage space 127 00:04:53,850 --> 00:04:55,650 on my virtual server. 128 00:04:55,650 --> 00:04:58,110 As you can see here, the first option we had 129 00:04:58,110 --> 00:05:02,250 only had 512 megabytes of RAM, which is really low. 130 00:05:02,250 --> 00:05:04,170 The second one is one gigabyte, 131 00:05:04,170 --> 00:05:05,850 the third one is two gigabytes 132 00:05:05,850 --> 00:05:08,130 and it keeps doubling as we move to the right 133 00:05:08,130 --> 00:05:10,710 and the price also doubles in turn. 134 00:05:10,710 --> 00:05:14,310 You'll notice that the first three all use one virtual CPU, 135 00:05:14,310 --> 00:05:15,870 whereas the other ones are going to use 136 00:05:15,870 --> 00:05:19,200 two virtual CPUs or more as we continue to the right 137 00:05:19,200 --> 00:05:21,420 and see the higher price plans. 138 00:05:21,420 --> 00:05:22,980 On the storage line, you'll see 139 00:05:22,980 --> 00:05:25,290 the first level starts out with 20 gigabytes, 140 00:05:25,290 --> 00:05:28,860 the second is 40, the third is 60, then it goes to 80, 141 00:05:28,860 --> 00:05:31,740 then 160, and it keeps raising from there. 142 00:05:31,740 --> 00:05:33,270 As you look over to the right, 143 00:05:33,270 --> 00:05:36,030 you're going to see that the maximum plan size you can go to 144 00:05:36,030 --> 00:05:38,820 is actually $160 per month. 145 00:05:38,820 --> 00:05:40,710 This is actually a pretty beefy server though 146 00:05:40,710 --> 00:05:43,020 because you're getting 32 gigabytes of memory, 147 00:05:43,020 --> 00:05:46,440 eight virtual CPUs and 640 gigabytes of storage 148 00:05:46,440 --> 00:05:49,110 using a fast solid state device. 149 00:05:49,110 --> 00:05:50,070 So as you can see, 150 00:05:50,070 --> 00:05:52,920 you can actually pick pretty powerful servers in the cloud 151 00:05:52,920 --> 00:05:55,470 using even something as simple as Lightsail. 152 00:05:55,470 --> 00:05:58,290 The other nice thing is that you can always start out low 153 00:05:58,290 --> 00:06:00,210 and then increase over time. 154 00:06:00,210 --> 00:06:02,640 This is what's called vertical scaling. 155 00:06:02,640 --> 00:06:04,530 For example, if I decide to start out 156 00:06:04,530 --> 00:06:06,210 with this $10 per month plan 157 00:06:06,210 --> 00:06:09,090 and I wanted to create a new website on this virtual machine 158 00:06:09,090 --> 00:06:11,550 and I have 10 people per month going to that website, 159 00:06:11,550 --> 00:06:14,430 this $10 per month machine will be more than adequate 160 00:06:14,430 --> 00:06:15,420 to handle that. 161 00:06:15,420 --> 00:06:17,250 But if I start getting a thousand 162 00:06:17,250 --> 00:06:20,190 or 10,000 people a day going to my website, 163 00:06:20,190 --> 00:06:22,980 that $10 server is not going to be enough, 164 00:06:22,980 --> 00:06:26,910 but I can quickly go back and move up to a higher plan 165 00:06:26,910 --> 00:06:29,850 by simply going and creating a backup of my server, 166 00:06:29,850 --> 00:06:32,250 creating a new instance at the larger size, 167 00:06:32,250 --> 00:06:35,730 and then restoring that instance into the newer larger size. 168 00:06:35,730 --> 00:06:38,010 And at that point, that becomes my new website 169 00:06:38,010 --> 00:06:40,830 and I can delete the older instance that I had. 170 00:06:40,830 --> 00:06:42,630 Next, we're going to give our instance a name 171 00:06:42,630 --> 00:06:45,750 and I'm just going to call this Linux practice. 172 00:06:45,750 --> 00:06:47,790 That way I can remember what it's going to be 173 00:06:47,790 --> 00:06:50,700 and then you can also choose how many instances you want, 174 00:06:50,700 --> 00:06:53,130 and in my case, I just want one instance, 175 00:06:53,130 --> 00:06:54,960 but if I wanted to create five of these machines, 176 00:06:54,960 --> 00:06:58,080 I could do that here by just changing this to five, 177 00:06:58,080 --> 00:07:00,480 but we're only going to create one, so I'll leave it at one. 178 00:07:00,480 --> 00:07:03,810 And then we have these key only tags and key value tags. 179 00:07:03,810 --> 00:07:06,450 These can be used if you're working in a large organization 180 00:07:06,450 --> 00:07:08,760 so you can identify what project you are working on 181 00:07:08,760 --> 00:07:11,130 and that way the billing goes to the right place. 182 00:07:11,130 --> 00:07:14,400 Once you've done that, go ahead and click on create instance 183 00:07:14,400 --> 00:07:16,380 and now Amazon is going to work 184 00:07:16,380 --> 00:07:18,660 creating this instance for us, 185 00:07:18,660 --> 00:07:21,030 so they're allocating the amount of memory we wanted, 186 00:07:21,030 --> 00:07:22,650 which was two gigabytes of RAM, 187 00:07:22,650 --> 00:07:26,130 the one virtual CPU and the 60 gigabyte SSD. 188 00:07:26,130 --> 00:07:28,890 In addition to allocating all of that hardware for us, 189 00:07:28,890 --> 00:07:31,230 they're also going to be installing the operating system 190 00:07:31,230 --> 00:07:34,680 and then we'll be able to log in remotely into that server 191 00:07:34,680 --> 00:07:37,470 and be able to do whatever we want because we own the server 192 00:07:37,470 --> 00:07:41,070 and we have root or administrative access over it. 193 00:07:41,070 --> 00:07:42,570 Now another thing you'll notice is that 194 00:07:42,570 --> 00:07:45,420 there is an IP address associated with this server. 195 00:07:45,420 --> 00:07:48,073 Notice, it is 54.159.170.130, 196 00:07:50,640 --> 00:07:53,520 and we also have an IPV six version underneath it, 197 00:07:53,520 --> 00:07:56,880 listed with that long number starting with 2,600. 198 00:07:56,880 --> 00:07:58,890 This is how we would address that server 199 00:07:58,890 --> 00:08:03,890 and so if somebody went to 54.159.170.130 right now, 200 00:08:04,200 --> 00:08:05,310 it would actually bring up 201 00:08:05,310 --> 00:08:07,350 whatever this server's responding to 202 00:08:07,350 --> 00:08:09,750 if a web server running on it. 203 00:08:09,750 --> 00:08:12,030 In my case, if I try to go to that right now, 204 00:08:12,030 --> 00:08:13,710 I get connection refused. 205 00:08:13,710 --> 00:08:14,543 Why? 206 00:08:14,543 --> 00:08:17,070 Because we never installed Apache or another web server 207 00:08:17,070 --> 00:08:18,750 to answer up those calls, 208 00:08:18,750 --> 00:08:21,660 and this is because we chose to install just the OS 209 00:08:21,660 --> 00:08:23,700 and not the App + OS. 210 00:08:23,700 --> 00:08:25,710 If you had chose to use something like WordPress 211 00:08:25,710 --> 00:08:27,060 and I went to this IP, 212 00:08:27,060 --> 00:08:28,920 you would see the welcome to WordPress page 213 00:08:28,920 --> 00:08:30,780 for you to be able to configure your WordPress server 214 00:08:30,780 --> 00:08:33,240 through this web-based interface. 215 00:08:33,240 --> 00:08:36,809 Okay, now we see that our server has been fully brought up 216 00:08:36,809 --> 00:08:38,220 and it is fully running, 217 00:08:38,220 --> 00:08:40,320 and at this point we want to be able to go in 218 00:08:40,320 --> 00:08:42,330 and do stuff with this server. 219 00:08:42,330 --> 00:08:45,270 So we're going to click on where it says Linux practice 220 00:08:45,270 --> 00:08:48,090 and we can see here how you can connect to your instance. 221 00:08:48,090 --> 00:08:51,300 Now, Amazon makes this super easy for us by making it so 222 00:08:51,300 --> 00:08:53,820 that we can just hit connect using SSH 223 00:08:53,820 --> 00:08:56,490 and it will actually bring up an SSH instance 224 00:08:56,490 --> 00:08:57,570 in our web browser, 225 00:08:57,570 --> 00:09:00,030 which is a remote session to that server. 226 00:09:00,030 --> 00:09:03,240 Right now I am connected to that CentOS device 227 00:09:03,240 --> 00:09:07,350 and you can see that I am now logged in as CentOS. 228 00:09:07,350 --> 00:09:09,390 If I wanted to see what directory I'm in, 229 00:09:09,390 --> 00:09:11,310 I could use something like PWD, 230 00:09:11,310 --> 00:09:13,710 which stands for present working directory. 231 00:09:13,710 --> 00:09:18,120 And you can see here I am in the /home/CentOS directory, 232 00:09:18,120 --> 00:09:21,030 which is this user's home directory. 233 00:09:21,030 --> 00:09:22,890 If you look in here and do ls, 234 00:09:22,890 --> 00:09:25,290 this will tell us what is inside of this directory, 235 00:09:25,290 --> 00:09:27,780 and in this case there are no files or directories 236 00:09:27,780 --> 00:09:31,260 because this is a brand new server with a brand new account. 237 00:09:31,260 --> 00:09:33,870 Now, if I wanted to go to the root of this hard drive, 238 00:09:33,870 --> 00:09:37,890 I can do CD space slash, which will allow me to change 239 00:09:37,890 --> 00:09:39,990 into the root of this hard drive. 240 00:09:39,990 --> 00:09:41,910 If you think about this in terms of Windows, 241 00:09:41,910 --> 00:09:43,890 this would be going to your internal hard disk 242 00:09:43,890 --> 00:09:45,210 such as your C drive 243 00:09:45,210 --> 00:09:47,760 and looking at what files and folders are there. 244 00:09:47,760 --> 00:09:49,407 Again, I'm going to type in ls 245 00:09:49,407 --> 00:09:51,600 and this time I'm going to do -la, 246 00:09:51,600 --> 00:09:52,980 which says I want the long list 247 00:09:52,980 --> 00:09:54,600 and I want to see the attributes, 248 00:09:54,600 --> 00:09:56,610 and this is going to show me every file and folder 249 00:09:56,610 --> 00:09:59,070 that's sitting at the root of this hard drive. 250 00:09:59,070 --> 00:10:01,440 And as you can see here, we have several of them. 251 00:10:01,440 --> 00:10:04,860 Everything in that purple color is actually a directory. 252 00:10:04,860 --> 00:10:07,320 Everything in the light blue color is a link 253 00:10:07,320 --> 00:10:09,150 that's pointing to another directory. 254 00:10:09,150 --> 00:10:12,000 For example, if you look at the line that says Bin 255 00:10:12,000 --> 00:10:16,800 that has a symbolic link going to the usr/bin directory. 256 00:10:16,800 --> 00:10:18,060 The same thing with Lib, 257 00:10:18,060 --> 00:10:21,030 it's going to the usr/lib directory. 258 00:10:21,030 --> 00:10:22,170 Now, I know most of this 259 00:10:22,170 --> 00:10:24,510 probably doesn't make a lot of sense to you right now, 260 00:10:24,510 --> 00:10:26,100 but the point I wanted to make is that 261 00:10:26,100 --> 00:10:28,440 you are now connected to your Linux machine 262 00:10:28,440 --> 00:10:31,710 and can do whatever it is you want inside of it. 263 00:10:31,710 --> 00:10:33,390 So let me go back to my home directory 264 00:10:33,390 --> 00:10:37,980 by doing CD space /home/CentOS. 265 00:10:37,980 --> 00:10:40,890 Now from here, if I do ls -la, 266 00:10:40,890 --> 00:10:44,040 you're going to see I have no folders here 267 00:10:44,040 --> 00:10:45,570 except for that one hidden one 268 00:10:45,570 --> 00:10:48,210 that starts with a dot called SSH. 269 00:10:48,210 --> 00:10:50,430 In Linux, anything that starts with a dot, 270 00:10:50,430 --> 00:10:52,560 is considered a hidden file. 271 00:10:52,560 --> 00:10:55,230 If I just do ls, you won't see any of those 272 00:10:55,230 --> 00:10:57,930 because all of those files such as bash logout, 273 00:10:57,930 --> 00:11:02,040 bash profile and bash RC are considered hidden files. 274 00:11:02,040 --> 00:11:04,950 Now, if I wanted to create my own file, I can do that 275 00:11:04,950 --> 00:11:06,570 by using the command touch. 276 00:11:06,570 --> 00:11:10,860 So I'm going to say touch and I'm going to call this file.txt. 277 00:11:10,860 --> 00:11:13,920 By doing that, I just created a new file called file, 278 00:11:13,920 --> 00:11:15,510 but that file is empty 279 00:11:15,510 --> 00:11:17,550 because I haven't done anything with it yet. 280 00:11:17,550 --> 00:11:19,080 So I'm going to go ahead and clear my screen 281 00:11:19,080 --> 00:11:22,350 and I'm going to display one more time using ls -la 282 00:11:22,350 --> 00:11:25,260 and now you'll see file.txt is there 283 00:11:25,260 --> 00:11:27,210 and it has no dot in front of it, 284 00:11:27,210 --> 00:11:29,580 meaning it's not a hidden file. 285 00:11:29,580 --> 00:11:32,190 Notice though in the fifth column, we have a zero 286 00:11:32,190 --> 00:11:34,110 and this is the size of that file. 287 00:11:34,110 --> 00:11:36,270 That file is zero bytes in size 288 00:11:36,270 --> 00:11:38,280 because there is no contents. 289 00:11:38,280 --> 00:11:39,420 When I use the touch command, 290 00:11:39,420 --> 00:11:41,370 I'm just creating an empty file. 291 00:11:41,370 --> 00:11:43,680 Now if I wanted to enter something into that file, 292 00:11:43,680 --> 00:11:45,780 I can do that by using a text editor. 293 00:11:45,780 --> 00:11:49,140 And on Linux there's a text editor known as VI. 294 00:11:49,140 --> 00:11:53,310 So I'm going to type in VI space file.txt and hit enter. 295 00:11:53,310 --> 00:11:54,693 And by doing that I can now see 296 00:11:54,693 --> 00:11:56,970 that this was a blank file. 297 00:11:56,970 --> 00:11:58,770 Notice all of those little squiggly lines, 298 00:11:58,770 --> 00:11:59,670 notice the tile dot, 299 00:11:59,670 --> 00:12:02,490 just shows me that each of those lines is blank. 300 00:12:02,490 --> 00:12:04,530 Now, if I wanted to type something here, 301 00:12:04,530 --> 00:12:07,530 the first thing I need to do is type in the I key. 302 00:12:07,530 --> 00:12:09,840 This moves me into what's called insert mode, 303 00:12:09,840 --> 00:12:12,150 and now I can type things into here 304 00:12:12,150 --> 00:12:13,470 and be able to write them. 305 00:12:13,470 --> 00:12:17,313 So I'm going to say this is Jason's test file. 306 00:12:19,170 --> 00:12:24,170 We are writing information into it using VI, okay? 307 00:12:25,230 --> 00:12:27,210 Now that we are done, I'm going to go ahead 308 00:12:27,210 --> 00:12:29,520 and type in the escape key, 309 00:12:29,520 --> 00:12:31,530 which puts me back into command mode. 310 00:12:31,530 --> 00:12:33,960 Then I'm going to use the colon key, 311 00:12:33,960 --> 00:12:36,450 and you can see the colon now shows up at the bottom. 312 00:12:36,450 --> 00:12:39,300 I'm going to do W for right and Q for quit, 313 00:12:39,300 --> 00:12:40,980 which will then save this file. 314 00:12:40,980 --> 00:12:43,170 And you'll notice it says one line was written, 315 00:12:43,170 --> 00:12:45,270 72 characters were written. 316 00:12:45,270 --> 00:12:49,650 So if I clear my screen and I do ls -la this time, 317 00:12:49,650 --> 00:12:51,960 you can now see that we have 72 bytes there 318 00:12:51,960 --> 00:12:54,840 instead of zero bytes inside the file. 319 00:12:54,840 --> 00:12:57,000 Now in Linux, if you want to display the contents 320 00:12:57,000 --> 00:13:00,450 of a file to the screen, you can do that by typing cat. 321 00:13:00,450 --> 00:13:04,320 So I'm going to do cat and then my file, name of file.txt. 322 00:13:04,320 --> 00:13:06,480 And when I do that, we can now see the contents 323 00:13:06,480 --> 00:13:09,540 of that file, which is this is Jason's test file. 324 00:13:09,540 --> 00:13:13,110 We are writing information into it using VI. 325 00:13:13,110 --> 00:13:17,070 So as you can see, I have full access on this Linux system 326 00:13:17,070 --> 00:13:19,440 to pretty much do whatever we want at this point 327 00:13:19,440 --> 00:13:21,120 because we own this server. 328 00:13:21,120 --> 00:13:24,060 I could start installing programs, I could run a web server, 329 00:13:24,060 --> 00:13:25,830 I could do pretty much anything I want 330 00:13:25,830 --> 00:13:28,020 because it is my own server 331 00:13:28,020 --> 00:13:30,360 and nobody else has access to it. 332 00:13:30,360 --> 00:13:32,160 The only real limitation here is that 333 00:13:32,160 --> 00:13:34,200 we are using a command line interface 334 00:13:34,200 --> 00:13:36,180 instead of a graphical user interface. 335 00:13:36,180 --> 00:13:38,280 So you have to get comfortable using Linux 336 00:13:38,280 --> 00:13:40,020 in the command line if you want to run 337 00:13:40,020 --> 00:13:41,820 and operate this server. 338 00:13:41,820 --> 00:13:43,890 Now, this is a very common thing in the cloud. 339 00:13:43,890 --> 00:13:46,440 Most cloud servers are going to be text-based 340 00:13:46,440 --> 00:13:48,390 because we don't want all the extra overhead 341 00:13:48,390 --> 00:13:49,740 and processing requirements 342 00:13:49,740 --> 00:13:52,380 that a graphical user interface provides for us. 343 00:13:52,380 --> 00:13:53,213 Because of this, 344 00:13:53,213 --> 00:13:55,260 when we use a text-based interface like this, 345 00:13:55,260 --> 00:13:58,020 we can use less expensive and less powerful servers 346 00:13:58,020 --> 00:14:00,840 and still provide support to a large audience. 347 00:14:00,840 --> 00:14:02,940 For example, if this was a web server, 348 00:14:02,940 --> 00:14:05,220 this little $10 per month web server can host 349 00:14:05,220 --> 00:14:08,610 probably a hundred to 500 people pretty comfortably. 350 00:14:08,610 --> 00:14:10,470 Now, if I started getting thousands of people, 351 00:14:10,470 --> 00:14:13,410 I would've to upgrade to the 20 or $40 per month plan 352 00:14:13,410 --> 00:14:15,510 and keep upgrading as my audience grew 353 00:14:15,510 --> 00:14:17,370 for my particular website. 354 00:14:17,370 --> 00:14:18,270 Let's go ahead and go back 355 00:14:18,270 --> 00:14:20,790 to our Amazon Lightsail interface, 356 00:14:20,790 --> 00:14:23,130 and here you can see that you can also connect to this 357 00:14:23,130 --> 00:14:24,990 using your own SSH client 358 00:14:24,990 --> 00:14:26,520 instead of using the browser based one 359 00:14:26,520 --> 00:14:28,140 that I just demonstrated. 360 00:14:28,140 --> 00:14:30,390 If we go to the next tab, you'll see storage, 361 00:14:30,390 --> 00:14:33,180 and here you could see I have a single system disk 362 00:14:33,180 --> 00:14:35,280 that was 60 gigabytes in size. 363 00:14:35,280 --> 00:14:38,160 Now you may find that 60 gigabytes is not enough space 364 00:14:38,160 --> 00:14:39,600 for you, and if that's the case, 365 00:14:39,600 --> 00:14:41,760 you can actually add a additional attached disks 366 00:14:41,760 --> 00:14:43,380 using the interface here. 367 00:14:43,380 --> 00:14:46,200 To do that, we'll simply click on create new disk, 368 00:14:46,200 --> 00:14:47,310 and then you'll be able to select 369 00:14:47,310 --> 00:14:49,110 how big of a disk you want. 370 00:14:49,110 --> 00:14:52,320 Now again, disk face here is on an SSD, 371 00:14:52,320 --> 00:14:54,900 which is more expensive than using older, 372 00:14:54,900 --> 00:14:56,790 slower traditional hard disks, 373 00:14:56,790 --> 00:14:59,460 and because of that, you'll see the cost associated with it 374 00:14:59,460 --> 00:15:02,430 is going to be based on your size that you choose. 375 00:15:02,430 --> 00:15:04,320 For every gigabyte of space you want, 376 00:15:04,320 --> 00:15:06,300 you're going to be paying 10 cents per month. 377 00:15:06,300 --> 00:15:09,660 So if that 60 gigabyte space wasn't enough for me 378 00:15:09,660 --> 00:15:12,450 and I wanted to have an additional 64 gigabytes, 379 00:15:12,450 --> 00:15:13,283 I can do that, 380 00:15:13,283 --> 00:15:17,100 but it's going to cost me $6 and 40 cents per month to do that. 381 00:15:17,100 --> 00:15:17,933 Now the great thing 382 00:15:17,933 --> 00:15:20,280 about using a cloud-based interface like this though 383 00:15:20,280 --> 00:15:23,010 is that you can also choose any size you want. 384 00:15:23,010 --> 00:15:27,330 So, let's say I wanted to have a one terabyte drive. 385 00:15:27,330 --> 00:15:30,750 I could do that by doing 1,024 gigabytes, 386 00:15:30,750 --> 00:15:32,887 and you can see that would cost me $102 387 00:15:34,001 --> 00:15:38,250 and 40 cents per month to attach that to my Linux server. 388 00:15:38,250 --> 00:15:40,020 Just to show you how this works, I'm going to go ahead 389 00:15:40,020 --> 00:15:42,750 and create one that is 10 gigabytes in size. 390 00:15:42,750 --> 00:15:44,640 This will cost me $1 per month. 391 00:15:44,640 --> 00:15:48,120 I can give it a name such as storage disk, 392 00:15:48,120 --> 00:15:50,733 and then I can go ahead and create that disk. 393 00:15:51,660 --> 00:15:52,500 Once you do that, 394 00:15:52,500 --> 00:15:55,050 you need to select the instance you want to attach it to. 395 00:15:55,050 --> 00:15:56,820 In our case, I only have one 396 00:15:56,820 --> 00:15:58,650 which is my Linux practice machine, 397 00:15:58,650 --> 00:16:00,450 but if I had several instances 398 00:16:00,450 --> 00:16:02,760 such as my Dion training website and another one, 399 00:16:02,760 --> 00:16:04,980 I could choose which one I want to be attached to. 400 00:16:04,980 --> 00:16:06,840 And then you'll see that the path to this disk 401 00:16:06,840 --> 00:16:10,140 is going to be /dev/xvdf 402 00:16:10,140 --> 00:16:12,300 on my Linux system once I attach it. 403 00:16:12,300 --> 00:16:14,520 So I'll go ahead and hit Attach, 404 00:16:14,520 --> 00:16:19,260 and now that is going to be put into place on my Linux system. 405 00:16:19,260 --> 00:16:21,270 Next we're going to go back here to home, 406 00:16:21,270 --> 00:16:23,400 and then we're going to go down to Linux practice again, 407 00:16:23,400 --> 00:16:25,200 and here we're going to click on metrics. 408 00:16:25,200 --> 00:16:28,470 With metrics, I can see how hard my system is working. 409 00:16:28,470 --> 00:16:32,220 Now you can see here that this is my CPU overview graph, 410 00:16:32,220 --> 00:16:34,530 and as you see, we launched this server 411 00:16:34,530 --> 00:16:39,240 right around 3:52 PM on July 17th, 412 00:16:39,240 --> 00:16:40,920 and originally when we started the server, 413 00:16:40,920 --> 00:16:44,340 it was operating at about 20% CPU utilization. 414 00:16:44,340 --> 00:16:45,660 That's because there was a lot going on 415 00:16:45,660 --> 00:16:47,400 when we first started up that server 416 00:16:47,400 --> 00:16:49,560 and it had to bring itself up. 417 00:16:49,560 --> 00:16:50,760 Once that happened though, 418 00:16:50,760 --> 00:16:52,440 and we got back to our normal workload, 419 00:16:52,440 --> 00:16:54,360 when I was in the command line doing things, 420 00:16:54,360 --> 00:16:56,940 you could see it dropped down to about 1%. 421 00:16:56,940 --> 00:16:59,580 This is what we call the sustainability zone. 422 00:16:59,580 --> 00:17:01,650 Now, because this is a cloud-based system 423 00:17:01,650 --> 00:17:03,750 and we're using a virtual processor, 424 00:17:03,750 --> 00:17:06,180 Amazon is doing a lot of hard work on the backend 425 00:17:06,180 --> 00:17:08,250 to make sure we're getting good performance. 426 00:17:08,250 --> 00:17:10,920 Let's say for example, I use this to host a website 427 00:17:10,920 --> 00:17:13,140 and I get a lot of people that jump on my website 428 00:17:13,140 --> 00:17:14,609 all at the same time. 429 00:17:14,609 --> 00:17:16,800 Well, what'll happen is there'll be an increased demand 430 00:17:16,800 --> 00:17:18,569 and the processor will go up. 431 00:17:18,569 --> 00:17:20,130 As that processor goes up, 432 00:17:20,130 --> 00:17:22,980 you'll see it go into what's called the burstable zone. 433 00:17:22,980 --> 00:17:26,250 If you get between 40 and 60 or 80%, 434 00:17:26,250 --> 00:17:27,750 you can actually burst, which means 435 00:17:27,750 --> 00:17:30,514 that Amazon is going to give you additional capacity 436 00:17:30,514 --> 00:17:33,450 to be able to handle that load so your server won't crash. 437 00:17:33,450 --> 00:17:34,500 Now, they will do this 438 00:17:34,500 --> 00:17:37,440 for a certain amount of time per month based on your system, 439 00:17:37,440 --> 00:17:39,030 and so you only have a certain amount 440 00:17:39,030 --> 00:17:41,250 of burstable capacity available. 441 00:17:41,250 --> 00:17:42,690 You could see here on the bottom graph, 442 00:17:42,690 --> 00:17:45,180 that's the remaining CPU burst capacity, 443 00:17:45,180 --> 00:17:47,790 and we have lots of additional burst capacity available 444 00:17:47,790 --> 00:17:50,850 on our system because we haven't really bursted 445 00:17:50,850 --> 00:17:54,360 because we're not running a lot of stuff on this server yet. 446 00:17:54,360 --> 00:17:56,640 As we move up, you can also click on here 447 00:17:56,640 --> 00:18:00,150 and see other facts, things like your CPU utilization, 448 00:18:00,150 --> 00:18:01,380 your burst capacity, 449 00:18:01,380 --> 00:18:03,840 your burst capacity in minutes or percentage. 450 00:18:03,840 --> 00:18:06,660 You can also see your incoming and outgoing network traffic 451 00:18:06,660 --> 00:18:08,250 as well as status check failures, 452 00:18:08,250 --> 00:18:11,220 instant status check failures, system status check failures 453 00:18:11,220 --> 00:18:12,540 and things like that. 454 00:18:12,540 --> 00:18:15,420 For example, if we look at the incoming network traffic, 455 00:18:15,420 --> 00:18:17,370 you could see that there was traffic started 456 00:18:17,370 --> 00:18:20,010 and then over time that traffic has gone down. 457 00:18:20,010 --> 00:18:21,660 Now, why has that traffic gone down? 458 00:18:21,660 --> 00:18:24,720 Because the only person who has access to the server is me, 459 00:18:24,720 --> 00:18:26,610 and I've been talking to you for the last few minutes 460 00:18:26,610 --> 00:18:28,620 and not entering commands back and forth, 461 00:18:28,620 --> 00:18:31,230 which is why we saw that drop off as we got here 462 00:18:31,230 --> 00:18:33,570 to 405 in the afternoon. 463 00:18:33,570 --> 00:18:35,370 Next, we can click on networking, 464 00:18:35,370 --> 00:18:38,400 and from here you can see our public and private IP 465 00:18:38,400 --> 00:18:40,200 as well as our firewall for our device 466 00:18:40,200 --> 00:18:45,200 and IPV4 and our IPV6 networking and our IPV6 firewall. 467 00:18:45,630 --> 00:18:46,590 In addition to that, 468 00:18:46,590 --> 00:18:49,560 we have the ability to do load balancing or distribution, 469 00:18:49,560 --> 00:18:51,510 and this would allow us to have multiple servers 470 00:18:51,510 --> 00:18:53,760 that are answering up for a single website. 471 00:18:53,760 --> 00:18:56,610 In our case, we are not sharing traffic with anybody. 472 00:18:56,610 --> 00:18:59,460 We are only using a single server that we are talking to 473 00:18:59,460 --> 00:19:00,990 and that server's controlled by us 474 00:19:00,990 --> 00:19:02,850 and being used only by us. 475 00:19:02,850 --> 00:19:04,260 But if I was running a website 476 00:19:04,260 --> 00:19:06,870 and I was going from a hundred people to a thousand people 477 00:19:06,870 --> 00:19:08,220 to 10,000 people, 478 00:19:08,220 --> 00:19:10,710 I can actually have multiple systems working together 479 00:19:10,710 --> 00:19:14,070 in tandem to load balance across multiple instances 480 00:19:14,070 --> 00:19:16,680 to answer up requests from all of those people. 481 00:19:16,680 --> 00:19:18,330 Next, we can go back to the top 482 00:19:18,330 --> 00:19:20,280 and you can see that we have snapshots. 483 00:19:20,280 --> 00:19:21,390 Now, snapshots are the way 484 00:19:21,390 --> 00:19:23,940 that you can do a backup of your system. 485 00:19:23,940 --> 00:19:25,140 When you take a snapshot, 486 00:19:25,140 --> 00:19:27,180 it's going to take an image of the hard drive 487 00:19:27,180 --> 00:19:29,760 and store it in the cloud so that if anything happens, 488 00:19:29,760 --> 00:19:32,190 you can then revert back to that snapshot. 489 00:19:32,190 --> 00:19:35,100 In our case, I have the automatic snapshots disabled, 490 00:19:35,100 --> 00:19:36,720 which means it's not going to do a backup 491 00:19:36,720 --> 00:19:38,790 of my server every single day. 492 00:19:38,790 --> 00:19:40,860 This is actually considered a bad security practice 493 00:19:40,860 --> 00:19:42,540 because we want to be able to have snapshots 494 00:19:42,540 --> 00:19:43,920 if something goes wrong. 495 00:19:43,920 --> 00:19:46,710 So I'm going to go ahead and turn on my automatic snapshots, 496 00:19:46,710 --> 00:19:49,380 and you'll see that this will automatically take a snapshot 497 00:19:49,380 --> 00:19:50,610 every single day, 498 00:19:50,610 --> 00:19:53,490 and it will store my seven most recent snapshots. 499 00:19:53,490 --> 00:19:57,000 This way, it's a rolling backup that I can always look at. 500 00:19:57,000 --> 00:19:59,550 Automatic snapshots are build the same way 501 00:19:59,550 --> 00:20:00,990 as a manual snapshot, 502 00:20:00,990 --> 00:20:02,460 and so if you wanted to learn about the billing, 503 00:20:02,460 --> 00:20:04,410 you could look at that by clicking on that link. 504 00:20:04,410 --> 00:20:07,440 I'm going to say I understand and I'm going to enable it. 505 00:20:07,440 --> 00:20:09,840 In addition to that, instead of waiting for 2:00 AM 506 00:20:09,840 --> 00:20:11,520 to happen for that snapshot, 507 00:20:11,520 --> 00:20:14,100 I can create a snapshot anytime I want. 508 00:20:14,100 --> 00:20:16,380 When I do that, I'm just going to give it a name. 509 00:20:16,380 --> 00:20:17,790 This case, they already have one. 510 00:20:17,790 --> 00:20:20,730 It's a server name, dash and a unique identifier 511 00:20:20,730 --> 00:20:21,960 and hit create. 512 00:20:21,960 --> 00:20:23,970 When you do that, it's going to take a snapshot 513 00:20:23,970 --> 00:20:27,390 or backup of my entire server, and that way if it breaks 514 00:20:27,390 --> 00:20:29,460 or something goes wrong, I could always restore it 515 00:20:29,460 --> 00:20:31,500 from that snapshot. 516 00:20:31,500 --> 00:20:34,050 Next, we have tags, and if you look at tags, 517 00:20:34,050 --> 00:20:36,240 this is anything where you're going to be able to label 518 00:20:36,240 --> 00:20:38,130 this particular Lightsail instance 519 00:20:38,130 --> 00:20:40,680 so you can keep track of things such as its status 520 00:20:40,680 --> 00:20:42,810 or the cost that's associated with it. 521 00:20:42,810 --> 00:20:44,910 After that, we have the history tab, 522 00:20:44,910 --> 00:20:47,850 and this will tell us what has happened with this instance. 523 00:20:47,850 --> 00:20:49,980 You can see that we originally created this instance 524 00:20:49,980 --> 00:20:51,660 at 3:56 PM. 525 00:20:51,660 --> 00:20:55,140 We attached that 10 gigabyte hard disk at 4:10 PM. 526 00:20:55,140 --> 00:20:57,690 We created a snapshot at 4:15 PM 527 00:20:57,690 --> 00:21:00,210 and we enabled an add-on at 4:15 PM 528 00:21:00,210 --> 00:21:02,340 for those automatic snapshots. 529 00:21:02,340 --> 00:21:04,800 The last tab we have is the delete tab, 530 00:21:04,800 --> 00:21:06,600 and this delete tab is going to be the one 531 00:21:06,600 --> 00:21:08,370 that allows us to delete this server 532 00:21:08,370 --> 00:21:09,930 if we no longer need it. 533 00:21:09,930 --> 00:21:11,820 So let's say two months has gone by 534 00:21:11,820 --> 00:21:14,430 and you decided you no longer want to play with this server, 535 00:21:14,430 --> 00:21:17,017 and you don't want to be charged that $3 and 50 cents, 536 00:21:17,017 --> 00:21:19,770 $5 or $10 per month to keep it running. 537 00:21:19,770 --> 00:21:22,620 Well, you can simply go in here and click delete, 538 00:21:22,620 --> 00:21:24,600 and this will delete the instance. 539 00:21:24,600 --> 00:21:26,940 Now, if you delete this right now, 540 00:21:26,940 --> 00:21:28,200 we have that storage disk 541 00:21:28,200 --> 00:21:29,940 that's still attached to the instance. 542 00:21:29,940 --> 00:21:31,620 It will unattach the storage disk, 543 00:21:31,620 --> 00:21:33,840 but it won't delete the storage disk. 544 00:21:33,840 --> 00:21:34,860 This is why storage disk 545 00:21:34,860 --> 00:21:36,870 can be actually a pretty beneficial thing 546 00:21:36,870 --> 00:21:39,750 because I can store files from this Linux machine 547 00:21:39,750 --> 00:21:42,660 onto that storage disk, delete the Linux system, 548 00:21:42,660 --> 00:21:45,480 and then reattach that storage disk to another system, 549 00:21:45,480 --> 00:21:47,700 like another Linux system or a Window system 550 00:21:47,700 --> 00:21:50,160 that I would want to use in this cloud environment. 551 00:21:50,160 --> 00:21:52,380 And this is a good way to get data from one cloud instance 552 00:21:52,380 --> 00:21:54,960 to another inside of Lightsail. 553 00:21:54,960 --> 00:21:57,000 In addition to that, you'll also see at the top, 554 00:21:57,000 --> 00:21:59,310 we have the stop and the reboot button. 555 00:21:59,310 --> 00:22:02,190 If I hit stop, this will power down that instance, 556 00:22:02,190 --> 00:22:03,060 and that can be useful 557 00:22:03,060 --> 00:22:04,920 if you no longer want to use this instance, 558 00:22:04,920 --> 00:22:06,330 but you know you're going to come back to it 559 00:22:06,330 --> 00:22:08,970 in a couple of weeks, or you can reboot it 560 00:22:08,970 --> 00:22:10,770 and you'll use that anytime you're having an issue 561 00:22:10,770 --> 00:22:12,630 with your server or you need to reboot it 562 00:22:12,630 --> 00:22:14,190 to install some piece of software 563 00:22:14,190 --> 00:22:17,190 or apply some kind of a configuration setting. 564 00:22:17,190 --> 00:22:18,390 So that was a quick introduction 565 00:22:18,390 --> 00:22:20,730 on how you can create your own cloud-based server 566 00:22:20,730 --> 00:22:22,560 using Amazon Lightsail. 567 00:22:22,560 --> 00:22:25,470 I do recommend that you do this yourself, give it a try, 568 00:22:25,470 --> 00:22:27,030 and that way you'll have a CentOS machine 569 00:22:27,030 --> 00:22:28,890 that you can play with anytime you want 570 00:22:28,890 --> 00:22:29,973 sitting in the cloud.