Host Your Site On AWS - Ubuntu, Letsencrypt Ssl, Route 53

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] thank you for joining me once again and this tutorial will be creating we'll be learning how to create an ubuntu instance on aws and all we need to do is just log into our aws console and firstly we should check to make sure that we are on the correct zone where we want to create the instance you can create it in different zones for us we are not virginia and that's where we're going to launch our instance in and there's different options how to launch it just go to your instance click on the orange launch instance button and here we're going to search for ubuntu there we go and we'll see all the list of ubuntu [Music] uh operating systems we select the free tier because we want the three tier version and click on select and here we can choose the instance type the 3t legible one is d2 micro with one cpu on one gig of memory and here we look at our configuration details there isn't much to change here this is just a simple setup um we could do an im roll if we wanted to but not necessary for this tutorial and here we are going to max it out to 30 gig which is the maximum a large size for three tier instances and usually i like to add a name for my instances so here i'm adding a name for it and it's cp uh cp tutorial and we configure the security group here we don't have any setup um but this is a simple setup we can just create one here and we just give it a name um and then we configure the rule for now we'll just do the ssh later on we'll configure the http and https as well as the mysql and all the databases ports that we made for the ssh you can leave it on public or you can choose your ip address which is what i've chosen here and you check your review your details before you click on launch and yeah click on launch and this is very important here you need to download your key pair this gives you access to this instance from ssh terminal or even on filezilla whatever you choose to connect to it with so we'll give it a name and then we're going to download this keypair and you must try and keep this safe because anyone with access to this keypad can actually access your server and once that is done we can click on launch instance and launch an instance you can see the instance is now launched then we go to the dashboard we should be able to see the instance but it's on pending right now it takes a few seconds um to get up and running if we refresh it which we should do uh if we refresh it now we should be able to see it uh running there you go so the instance is active but we need to now assign an elastic ip to it so that we don't use the the dynamic ip changes every time we restart the server so we should allocate an ip uh to this instance so that you can stay constant so we can check uh for a ip address by searching for it on the services panel that's one way to go we can also find it on the left hand side uh toolbar on the left hand side bar or down there you can see the elastic ip or we can just search for it either way whichever option you choose you can easily find anything you're looking for if you just search for it i prefer to search for it and you just search for elastic ip and you click on it and it should bring you to this um elastic ipcontrol panel and once we are located you there you go you click on allocate ip addresses and here there isn't much to configure just choose from the amazon pool and if you want you can give it a name tag as well which is usually what i do i'll give it a name and just call it the name of my instance and then put ipad at the end so that i'll know which is which because over time if you keep creating instances you might get confused as to which ip is for which so it's good practice to give it a name and then click on allocate and once it's located now you have to attach this ip to the instance we've already created so that's what we should do and you click on actions and you go down to associate ip address and you choose instance in this case and then select the instance and then you also select the private ip for this instance and this will make sure that the ip address is tied to this instance and then we click on associate and once that is done we can now verify that the instance is not connected to this particular elastic ip so if we go back to our ec2 dashboard and go into instances and then we can click on the instance and then we can see the new ip address which we have just created is now associated with this instance and if we go back to if we go back to the elastic ip dashboard if we go back which is somewhere here we can just search for it if we go back to the elastic dashboard there we go we can verify that the ip address and the one in the instance is the same which tells us that we've successfully attached this ip address to this instance so that's pretty much it from there on we can use it to connect on ssh into this into this server thank you peace hey guys welcome back in this uh tutorial we're going to install apache 2 on our server that we created in the last lesson so here i'm connecting uh to the server uh the ec2 server that we created there's two ways to do it either with the dns address or with the ip address um i'm going to show you how to connect with the ip address now so if we clear the screen and we do the normal commands and you can see we've selected our key file and then we're connecting with the ip address that we assigned the elastic ip that we assigned on the server in the last tutorial and that will give us access to the uh to the server ssh and obviously the first thing before you start installing anything is to check if there's any upgradable packages so sudo apt update will give us a list of upgradable packages and once we check that i think there's about eight packages that can be upgraded so we just run the upgrade command and here you can just press enter because y is basically the default and it's going to read and install all the available packages you just have to wait for it to complete and once that is done we can now proceed with the next step which would be to install apache server and here okay so the upgrade is done and now we type in the install apache tool command and that will also run fairly quickly and that should be eight yeah so that's basically done and here we can check the status of apache once it's installed it usually just starts to run automatically but we also have to since it's a server that's gonna be running a website or some other app we have to decide at some point we're gonna run with this uh server we have to figure out a way to make it uh always rested um to actually run on restart so we type in the systemctl to enable apache to to run at every reboot and here we can check the apache version and pretty much that's that's it we've actually configured apache and now we can change the directory uh the server directory www directory so that we can be able to run things like wordpress on it and that's pretty much all we need to do reload apache and we're done so thank you for watching and share and like and subscribe peace hey guys welcome back again to another tutorial today we're going to connect our domain name to our ec2 instance that we created in the previous videos um right now the domain we're going to be using is this domain the quotes and pixels dot me registered at pogba um they're not sponsoring me anyway so uh we go to route 53 on aws firstly we need to create an a hosted zone basically like a like a container that will hold this particular domain for us and we put in the domain name i usually put in the domain name and then i also give it a description so i and a tag so i can be able to uh distinguish which domain in switch because as you keep adding more domains you probably gonna end up confusing yourself with which domain is switch so i give it a name on the tag and then we proceed once you do once you create a hosted zone it's going to create dns servers and that it's gonna create some uh name servers for you to use so you're gonna copy that and go back to your uh where you registered your domain maybe go to i use pokebond enum is another one and you replace your default name service with the amazon name service and that's what i'm doing here once you do that there's actually not much else you need the only thing i figured is that sometimes you have to add the the ipr the elastic ip address of the ec2 server on your domain register as well i do that it's not necessary but i do that as well um so now we go back to our um so here we've we've actually added the name servers now i'll go back to our instance we go we pick the ip address which is the elastic ip that i've been working with and we go to the zone file on our registrar and we create an error code for the the domain i'll call some pixels we save that and then i also create another uh a couple of them i think three of them so we have the one for cuts and pixels the one with the wildcat and then the www uh domain and we tied those two to the ip addresses the rest of those zone records we're going to delete them because we don't need it so once we're done we close this i will come back here to delete those later stage and then we go to our route 53 and we start creating our records on the route 53 since once the the domain resolves and everything is routed via aws uh servers then we have to now create our records on the on the hosted on the hosted zone on aws so here i'm removing the the records that are on pogba so that it doesn't conflict with the one on aws if you just registered your domain and you've not used it for anything you probably won't have much of this um on your on your domain records but i've been playing around with this uh in previous tutorials and testing that i've been doing so that's how i have a lot of these uh on i'll still share those tutorials later on so this is what you should have on your zone file uh and and they should be good to go so you have the the domain the wildcard and the www and that's it you're done basically with pogba or your domain registry and here you go back to route 53 and we go to our hosted zone before we do that i usually use dns checker to check the name server to see if it's resolved is a very good tool actually so here i type in the domain and i select the name server and i click on search once you click on search it's going to go through and it's going to try and see if it's uh if it's resolving correctly so you'll see the the name service that we we added it's now showing up with uh with a green check mark on it if it's not resolving you'll see it as a as a red red cross on it so everything seems to be fine um right now so the next thing we have to do uh is to go back to the ec2 server the instance and once we are there we're going to pick the copy the ip address the elastic ip address and we go back to route 53 and we go to our hosted zone we only have one but as we grow we're gonna have other ones there so we go to cut some pixels and we open that uh hosted zone and we're going to add more records on it so here we are in the normal record and we tie it to the ip address and it's going to be an a record and create that record we could have actually done all of them in the same window but let's do it one by one so you can understand and here with window wildcard one and we also make it an a record and we add it at the ip address and the last one i think should be the www record so we type that in www and we add the ip address the elastic ip address and we create that record and i think that's uh pretty much all we need to do for now so um if we go to dns checker and we check the a record now and as you can see the the setting is on the a record and you can see this takes a little bit more time to resolve so just be a bit patient with it because remember we removed uh some of the information on pogba so it's gonna take a while to to to resolve all of it if we try the to access the domain we will not get access to it i'll tell you well the reason is because our security group when we created the instance we only allowed access to ssh so now we need to add make some changes on the security group so we can add http and https access as well as mysql and any other ports we need to open so we open the security group um you see here we only have the ssh enabled so the inbound rules is only ssh that is open so if we open the security group we go to edit i'm gonna go to edit rules and here you see that the only rule we have is inbound is a ssh so we're going to add http and we're going to add https and we're going to add uh my mysql because we're going to be running wordpress later on and these three we should do for now and we open the parts to anywhere or to specific ip addresses if you want that's up to you but i usually do it this way and save the rules now if we go back to the browser and we try to access the the domain we should see that the the new domain is now an active and available publicly and there you go so thank you for watching and come back again for the next lesson like share and subscribe peace welcome back guys in today's lesson we're going to be installing mariadb on our instance and all we need to do is to type in the mariadb installation command and once we do that the installation is fairly quick press typing yes and press enter the installation will begin and once we are done with that we check the status of mariadb which usually actually starts automatically once you install it but the next thing we have to do now is to make sure that it's able to restart automatically every time we reboot the server so we type in the system ctl command to enable that and next we're gonna run the mysql uh post installation script here it's asking for root user password which we don't have so we press enter and then it's going to ask us to set a root user password you type in the password and re-enter it as well and press enter and the prompts that come up uh just press enter and keep going all the way to the end and just press enter enter yes it's the default and you get to the end here it's already installed so now we're going to test the password we created for the root user and as you can see that we're able to log in so that's pretty much it next lesson we're going to install a phpmyadmin which we're going to use to manage our mysql server thank you for watching please like and subscribe peace welcome back guys in today's lesson we're installing php on our aws instance uh continuing from our last lesson so here's the php command i added a few modules that will help us run things like uh wordpress so that we don't have to install it later on so once you type in the php install command you just press enter and you just patiently wait for it to install it shouldn't take that long it's just a fairly good process um it's just basically speeding through it right now and so basically once that is done we will enable the php module and right here we just type in the enable php module command and once that is enabled you just restart the server here i'm checking the version of php download installed which is 7.4 and you can create a php info so you can check if php is actually running correctly with all the modules so you just do sudo nano create a php info dot php file on your server directory and here we can see when we go to that file on our domain you can see the php is enabled on this uh summer and it's running correctly now in some instances you might need to install php fast process manager which is what we're going to do right here um you just type in the install php fpm command and here we go it's already installed and you can also install the set environment variable module with the cgi as well and we've done that you just restart php once that is restarted you enable the php fpm module and none is enabled but you still also have to disable the actual php module that you installed previously so that the server will run with fpm instead of the normal php that we installed before so if you haven't done that these added commands to use to disable php and enable php fpm if we go back to our php info document that we created you can see that if you refresh it you will see that php the summer api is now the fbm module thank you once again and please like and subscribe and share if you like this video hey guys welcome back to our lesson on adws for beginners today we're installing let's encrypt on our aws instance that we've been working on so the first thing we need to do is to set up caa records and to do that we have to go to route 53 and we're going to use the domain i've been working on quizzes the codes and pixels dot me and we did set up this hosting hosted zone in one of our previous lessons so what we need to do is go back into it and we click on create record and here we select caa as a record type and we type in the let's encrypt in the value for this record type and we save that optionally we can also add another ca record if you want to receive notifications about any malicious uh problems regarding your certificate but we're not doing that for this server we just want to keep it simple and straightforward so we're not going to do that so we're going to cancel out of here and that's pretty much it for route53 next we're going to install satbot client for ubuntu and here's the command for it once we type in the command we press yes and we let it run and once that is done we're going to enable https with the apache plugin and here's the command to issue the certificate for this domain and a couple of other sub domains that i'm going to use later on they're not active yet but i might as well just issue this attribute for it right now so i don't have to do it later on so that's why these options are coming up if you're just doing it for your normal domain you will not get the screen but if it does come out just select uh the default ssl config file here you can see that the certificate has been issued correctly and successfully so next we just check the directory to see the two files have been created by default by let's encrypt let's test the domain and see if this certificate has been currently issues issued we could actually test all the other sub-domains but since they are not active right now it will come up with anything but this particular one is uh this particular main domain is already active so we check for that and you can see it's successfully been issued but before it's going to work on the on the on the domain itself we should redirect http to https so that's what we're doing here so we open the default config and here we change the rewrite rule for this particular domain we replace server name with our domain which is called some pixels dot me i personally like to run my domains without a www but if you prefer the www in front of it you can put it uh it's it's all about preference so here we just type in the domain to replace our name and we save this file just be mindful of your typos so we correct that and that should be codes and pixels okay so that's done next we're going to edit the the ssl version of this default config file so here we're going to add the rewrite command there you go so we add that just remember to change the server name to your domain name as well and we save the file we reboot apache and we go to the domain and we'll see that the domain is now redirecting correctly and that the ssl certificate is active if you click on certificate you will see that the ssl certificate has been issued correctly and it's active on this domain so next we're going to disable tls a version 1 and version 1.1 which is no longer secure so that's what we're going to do now and to do that we will open the um i think it's called the options uh yeah the options sso file and here we go to ssl protocol and we just add tls version 101.1 and that's pretty much it we save this file and we exit out of it and we reboot apache and that's pretty much it now we would like to certificate to automatically renew on his own so we don't have to come back and do it every 90 days so if we open the contra file we select nano i usually use nano as my editor and we add the renewal prompt for rate it to check and it will also renew it and restart the the server on its own if you want here as well and you want to receive those emails you can also add your email address here if you want to but it's not necessary but that's pretty much it so thank you so much for watching and please like share and subscribe peace
Info
Channel: Codes and Pixels
Views: 418
Rating: undefined out of 5
Keywords: amazon web services, aws tutorial, aws training, aws tutorial for beginners, aws, ubuntu 20.04, mariadb installation, php, how to install mysql, web development, ubuntu server, apache server, how to install ubuntu, web developer, apache2, let's encrypt ssl, aws web hosting step by step, amazon s3, route 53, aws ec2, aws static website hosting, aws ec2 tutorial, aws website hosting, aws hosting and domain, amazon web hosting wordpress, aws hosting website, aws ec2 instance
Id: U0NlnJrLsWg
Channel Id: undefined
Length: 31min 11sec (1871 seconds)
Published: Sat Feb 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.