Installing nginx on Amazon Linux on an EC2 instance

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm gonna show you how to install nginx on a Linux ec2 instance on AWS Here I am on the AWS management console we're going to go to ec2 and get started I have no running instances I have some terminated ones then I was playing around with so I'm gonna launch a new one start over fresh I'm just gonna take this top one here it's a free tier eligible it's a good one to mess around with we're just gonna go with the default settings launch we're not gonna do anything special with Keys I'm actually just going to use the web-based SSH that you can use in the aw AWS console I'll show you that sec and so I acknowledge and launch and at this point we wait we've got here this instance which is pending it's getting going take a minute or two and we'll be up and running and when it is we'll start this video back up no use in you know sitting here and just watching this thing spin okay now we have a running ec2 instance let's select it and connect we're just going to use this browser-based SSH connection as I mentioned and here we go we are in with our brand-new ec2 instance even though it's brand new we actually need to do a yum update if you look at the message here it says nine package just needed for security out of 18 available run sudo yum update to apply all updates so I'm gonna do that because we're gonna use yum here in a minute to install engine X and so I want to get all of this noise out of the way so let's do sudo yum update yes let's install all of them and this takes 30 seconds or so and there we go everything is now up today you might find this command useful if you do cat on et Cie / OS release you find out information about your linux version and so in this case it was on linux version 2 it is like sent to us we are going to use the instructions for sim 2's here in just a second to install nginx and so that's why I wanted to show you this alright so now that we know that were sent to us or likes in to us anyway let's go to in genetics so here's the engine X website it's got instructions on how to install here synthase or Cintas to add engine XT on repository create a file named et Cie yum dot repost d / nginx repo so let's do that and so i'm going to take that and do a sudo won't use them and create this file it's blank so let's take the contents of this right here paste it in now an important thing to do here as it says below this is you need to manually replace the release verb with a valid number I'm going to change it to 70 it says 5 or 6 there on the page but that didn't actually work for me so we're just gonna go with 7 and this will work just fine alright now yum when I do him out Dave will now know about engine X so let's do sudo yum update and we won't see much because you know we got rid of all the noise earlier by doing an update but we do see engine exit now knows where it is that's pretty nice so now let's do a sudo yum install engine X and so this will actually install nginx on the machine there we go we're good to go now next is installed not running let's test that let's do it Perl to localhost port 80 nothing there all right well let's get engine X started so sudo service and unix start alright so now it's it's actually going so let's go back and do our curl again and this is the default engine X HTML page so that actually worked just fine if we want to stop the service you can do that if we do curl once again it doesn't work so let's get it started and everything at this point is good all right we can now curl and engine X is running what's what we want to do now though is even though intern X is running and we are technically done we can't actually see it at least externally because right now the security rules don't allow any inbound HTTP connections on port 80 so let's go do that so let's go to launch security wizard six down here on our instance information and that could say something else launch so launch wizard 1 or 2 or whatever but that's what we want this will take us to our security groups and so we're gonna go to our inbound rules and we're going to edit those we're gonna add a rule for HTTP port 80 is actually nothing else to do just HTTP and it defaults to what we want so I'm gonna save that now we should actually be able to hit this in the browser so let's go see we've got this one going let's let's open up a new oh we don't need to open up a new tab that figured itself out we got everything opened up on port 80 they're all good to go see everything is installed let's go change the default HTML page and nginx that's actually the that's actually just the the directory so let's just look at look at that so if you do an LS on user share engine X HTML you can see there's our index.html file that's actually what we wanted to change so slash index dot HTML oops I like actually to leave my errors in video so I'm just gonna leave that right there alright welcome to engine X in our new ec2 instance save that come back refresh boom we've now got an ec2 instance up and running we've got Engine X installed you've got where we can hit that server on port 80 and I've shown you how to change the default HTML page so we are at this point officially done that's how you get internets started at least right now before various OS and AWS changes to change things at least for right now this is a fairly simple processes there's multiple steps but it's not too complicated once you figure them out and that's the purpose of this video so good luck with your engine X explorations
Info
Channel: Eric Sowell
Views: 25,549
Rating: undefined out of 5
Keywords:
Id: leCZ7htfB_g
Channel Id: undefined
Length: 8min 23sec (503 seconds)
Published: Mon Jan 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.