AWS Tutorial: How to Host a Website on AWS EC2 Instance

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys in this video I'll be showing you how to host your own website on your ec2 server so I have my website folder and the files on my local computer which is right here and when I open that folder I have my index and all these CSS J's and files that goes with this website so I'll just launch this website now just for you to see and you can tell that I'm launching it from my local because it's showing the address over here so now I want to get all this files on my ec2 server to be able to launch it I downloaded this just to give him credit I downloaded this website from this guy's web page he has a bunch of website over here that you can use as an example to follow along I will include the link to his website on the description so you can go download any of these template just to follow up with this example so I have my website folder here with all my files in it the first step I need to do is zip this file so this zip this folder so I'm going to click send to zip and zip it so now I have my zip folder in here so just I want you to take notice of something when I click on my zip folder notice that I have another folder in there which is called velocity and in there is where in that velocity folder is where my files are located so we have two two folders so we have one which is the zip and another one which is the main folder with a lot of file so just keep that in mind also the next thing we are going to do is go into the management console and under service s3 then we are going to create a bucket and upload that zip folder into that pocket so click create a bucket and I'm just going to give it a name my web server one two three four five so I just create any name Webster Webster buy one two three four five all of my settings is going to be default so I'm just going to create a click create so I leave it on that region and click create so I have my web web server bucket so open that bucket and I'm going to upload my zip folder into it so select my velocity zip folder and open and upload so I've uploaded into it the next thing we have to do is make that pocket and the object in the bucket public so go back to my bucket select it over here probably edit public access settings click that make sure this is on check click Save over here and in here type come from click ok so the next thing we are going to do is go into that bucket click the velocity and open I mean click it not open but on that action you want to click make public and click on from here and with made it public and we can tell that it is probably because when we open it and when I click open it's downloading to my local computer so damn is that object that food that is probably good so that's the first step so the next step is we want to launch our ec2 instance so we'll go to service on that compute ec2 and running I'm just going to launch an instance and I'm just going to select the Amazon Linux 2 and T 2 micro so everything is going to the default so just click Next attached storage for the tag we can just add a name and I'll call it city and create my security group so for the security group already have an existing one but we can create a new one so the first one we need is an SSH so Dan is already created for us the next one we need is we can add an HTTP so HTTP and from we can add it from our source can be IP before in ipv6 so we'll leave it as that and click Launch review and launch review everything launch choose a key pair so I already have a key player choose an existing one and launch my instance so I wait for my instance to lunch then we can move on to the next step so now that our easy to instance is running first thing we need to do is select it and on that the ipv4 public IP copy the IP address your public IP address into your clipboard and the next thing we need to do is SSH into our ec2 instance so I'm using window and I'm going to use putty so body open the first thing I would do is in under this session typing you see - you see - I find user add and paste your public IP address that you copy in there and I'll let me change my fonts so everything is bigger so in here you can pick which ones you want you can print the font type I'm just going to increase it to 14 so you can say Clara on the screen and click OK then on that SSH click SSH click the drop down and on that the up I'm going to browse the way I save my key K so I'm going to select this key back as you can see this is the same key that I'm using for my easy to instance open it just to show you everything is complete so we have easy to use that our public IP address we already added our keeper and click open get this option click yes so now I am my ec2 instance so the first thing I would do is type of sudo su and that would change my changing to root the next thing I would do is update my ec2 instance click type in your update - white click enter and that's going to install the patches and update my c2 instance they increased it so you can see and once that is completed then we can move on just give it a second good that's conflict so I can click my screen type in click to clear my screen the next thing we are going to do is install Apache so we will type in yum install install HTTP D minus y and type enter and that's installing Apache and now to know what directory directory you are in you can type in PWD and that's telling you that you are in the whole easy to use a directory so to change directory you use the CD command so to go into our H bad dub dub dub directory all we have to do is type in CD C this stands for change directory CD Wow dot dot dot slash forward slash HTML so now we are in this directory and when I type in LS just to show us in the directory the directory is empty so we make sure you are in your bad dog dog dog HTML directory typing airless there's nothing in there and now what we have to do now is copy the zip folder for our web our website that is on is three pocket into our ic2 instance to do that you type in W get space then go back to your management console and I'm going to open this on a new tab and I will go to my s3 bucket and confront that bucket open that folder so just copy the object URL over here so select it and click copy then I'll go back into party and so type in W get space and paste that object URL in here and click enter and that is downloaded the zip file so the next thing we want to do if I type in LS you can see the velocity the zip file in there the next thing I want to do is unzip this zip file so that we can access the files in it so to zip it all your type is on zip then you type the folder name so we type the LA City and miles as a capital letter so you have to type it exactly obviously how it is velocity velocity thoughts is it so that's what your type worry about your folder name is you type everything what about this rate then if that's what you type here so we'll type that and click enter and now it has a zip our file and you can see all the files in our folder here so we can type in LS and we can say they unzip one over here so the next thing we need to do is move all the files that are in that zip files subfolder into our bad dub dub dub directory so I hope that makes sense so let me so if I go back to my desktop to show you what I mean so we have this zip folder when I click it there is this folder in there and this folder is the same as this blue one so now the files we are trying to get to is in that folder so that's the next step we are trying to do so we are trying to move all this file into our backup directory so to do that all you have to do is type in typing MV MV space then the velocity with the capital V I'm going to type the word as it is on the screen they'll make a mistake over there below city and I'm going to press my forward slash then I'm going to press this sign that looks like the multiplication sign space and dot and press Enter and now when I type in LS now you can see those files are in our directory that's exactly what you want so you want your HTML and all the files that comes with it in that directory so with that is everything the next thing we need to do and if we want to check out the directory we are in we can type in PWD and you can see we are now that the HTML and our files in that directory so the next thing we need to do is just that HTTP so we'll type in service HTTP the step and press Enter so we start our project so now when we go into our ec2 instance and copy that ipv4 IP public IP address copy and I'm just going to close this list open back up another tab paste it in there and press Enter and you can see our website and it's working properly everything is working fine that is how you hold your own website with all the folders or your ec2 instance I hope you find it helpful thank you and I will see you in the next one as I learn more thank you bye
Info
Channel: CAD Define
Views: 149,778
Rating: undefined out of 5
Keywords: AWS, Amazon, S3, sudo su, yum update -y, yum install httpd -y, chkconfig httpd on, cd /var/www/html, wget, How to, Website on AWS EC2 Instance, How to Host a Website on AWS EC2 Instance, Elastic Cloud Compute, ec2 instance, AWS EC2, SSH, instance’s public ip
Id: hOYg-ClP84g
Channel Id: undefined
Length: 13min 27sec (807 seconds)
Published: Tue Jul 30 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.