AWS Auto Scaling Load Balancer CloudFront Elastic Cache Demo with WordPress 2019

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is David way to once again and today I'm going to do some interesting things I'm gonna be say of our WordPress website in Amazon Web service already tell us yes see you can choose call ready and can choose some Bluehost there are plenty of options in your hand but I personally believe if your website is having at least 50 views or 50 physics in an hour then you should not choose any share of things and of course I can choose a VPS or dedicated server for dedicated servers are very expensive and cloud there yet cost-effective and reliable so today's video I'm going to do I'm going to discuss how we can set up of very highly reliable and fault tolerant WordPress website over AWS let's get started I'm already logged in and my Amazon Web service console I launched an instance from here instances just like a server I'll choose Amazon Linux - I'll choose treating micro which is having a one virtual CPU and one kicks off ram and also if you are a new customer then we are going to get 750 hours of tea to micro instance as free so let's go to next I'll give everything here as default and then I put eight weeks of storage that is sufficient for now and then I'll name it as name should be master web server this is this is this has been popped up already because I created previously with the same name but do not worry you can choose any name here even any key here so and the security I'm going to choose SSH which is actually open 422 port number 22 and web access that is actually for HTTP and HTTPS for 80 and 443 respectively everything looks good then launch I'm going to use my existing keys if you have not created any keys already then you can create it from here let's launch it eh it takes couple of minutes to get up so here with me so as you can see the instant state is running now I'll connect it as connector with connect this with SSH to configure you so to configure the server what I'll do I'll install Apache web server with WordPress and through configuration that I'm going to explain just now I'll just write a script all together to just save time so let's write the script as configure there are side oops that should be movie right so what what does this script - first I'll update my server then install Apache when I'll install PHP 7.2 and Mario to be a PHP driver that is actually required for Maya to be PHP connection or MySQL connection I can use Mario to be driver that is actually a new variant for my excuse my signal don't worry about my signal this is actually the same but I never get too far www HTML then I create a file called hell did or HTML which is actually required for health check-up later on then I'll download WordPress latest WordPress from wordpress.org and then I'll extract the whole content to forums of the bleed or HTML and then I'm removing all the downloaded content and then I'm changing some permission here likely change the permission of whole HTML directory here so that should be fur a little bit of blue and then should be HTML and this is also I like to change the internet directory so the next line actually I'm changing the ownership to Apache and then I'm starting the Apache web server and making the Apache web server is the web server service Linux service to be started on startups okay share it and then run as should oh Sh and configure so if everything goes correct then you will arrive here which will actually create a some symbolic link of your HTTP service because we have executed chk config has suitably on so let me check everything up or not so I'll just right-click on this domain and then I'll paste it to my browser looks like everything fine so let's just make a small test I'll just chop this server here so obviously this will get offlined so as its it is showing stopped then I'll start it once again to test the chk config has been initialized or not so let's put the TNS one second here and looks like it's fine so as you can see whenever I'll be stopping or restarting my server here now IP is going to change if I do not add us elastic IP so as I'll make this server as a master node I always want that this IP should not get change every time if I restore it so what I'll do here from elastic IP I'll just add I'll just allocate one IP it should be amazing pool that's fine and with this IP this 3.19 dot 7.20 - I want to allocate I want to associate my master web server here okay you you so that is the monster web server that looks good and then I've got IP here and then if we go to this domain that is very fine and then I'll open up my domain provider and I'll just add one a records to associate with our domain name so here in this Doman I'll add some domain entry you like an era course and I limit to like say Q 2 3 demo master and I want to I want this to be pointed to end this IP perfect so let me just have a look obviously it is not going to propagate now oh it is propagated it's a miracle things usually does take a little bit time like ten minutes but it's instant right now that's fine now what I'm going to do I'm going to treat artists instance that is for my therapist you so I'll create Mario Devane stands for this and then I'll choose a dev test for now you can choose this one if you if you are deploying as a production but for now I'm choosing if our test so I'll choose the free toy here and then 20 TV is fine for now and then I'll put the TV instances WP the monster username should be root and putting some password here that should be something like this right so everything else I want to be default that's fine John the default PC subnet that shot beautiful public acts of accessibility I nearly as public for now literally can I can even modify it or anytime and the terrible name I want to put two to three demo this everything is closed well and this is the backup option you can even create any any shut up backup options take trainings from one day to some days but I'll keep the default one right now here and then everything else fine and created it with so obviously it'll take at least some time right seven to ten minutes so hanging for seven to ten minutes you so as you can see here it is available so my data was ingenious up so we can use it over our WordPress installation what we need from here that is this endpoint so let's go to the Waterside up and then hit continue and then explore database setup and then the database name that we have two to three demo that that is our database name and then a root and then passport I have given this ABCD efg 1 2 3 4 so the terrorist host should be your endpoint here we'll keep it demographics as WP I think there is it a small catch so I'll just cancel this progress here and then let's look for this this is the inbound traffic and we have to open our port to everyone for now so I'll go to the inbound and then I'll edit this rule and I'll make it anywhere for now and the everything else fine here if you submitted a little bit to go so we will run the installation here now I will put something two to three demo that is our nickname for this project and then I will put the username as very common things for now perfect so our work addresses up right now and then if we go to here like admin admin admin let's visit the side front it's completely okay so that's fine that is the star is our master node and let me show you what what we can do with this now we are going to connect our easy to instance now what what we will set up here we will set up to s3 buckets and will continuously sink all the codes and media assets from s3 to my ec2 instance so that when I will create load balancers it will be very helpful so let's connect and before that I want to create our I am role that is actually let's go to role then create role and I want my ec2 instances they should connect the AWS services such as s3 and others and according to their I'm I'm going to create a role and in this role I put this things as three full axis that means my incidents and instances are able to access s3 buckets okay so great I'll leave it for now I'll name it as three full access and that's clearly see to [Music] and then I'll catch this I am roll to my Moscow lips lips lips over so I'll do the instant settings and then I am rule and then here I'll choose a seraph Alexis great so now I will connect this monster note here what I'm going to do that I want first I want my coat the coat that should be continuously back top to is the bucket that will be something like this I need to go to s3 and then you pocket that should be key to 310 tablet with toad everything else is fine here you let's Inc now so I so when you have chosen Amazon Linux to area my butt is actually pre-installed with AWS CLI so we're going through this comment AWS s3 st. and then tillage until 8 mins the files which are not present and if those files are present on that pocket it should be delighted so s3 and then there should be directly for a little bit of blue and then HTML whatever there is an HTML I want to copy everything to s3 pocket and I'll just copy the bucket name from here you you looks like everything has off here that's great now what we will do will do the other way around because we are going to create a my from this instance so we are going to sign up a minute above kind of things so that our this s3 pocket toad the our code base and whatever changes will be here in this s3 that will be completely reflected to our all the instances so for that we want to do something like this we let's crater crontab for this for to drink crontab we have to edit this file menu and then a TC and then I should go real throne tab yes so I want this thing should be every minute so I'll do something like this I will just copy this line from here and then this is the one-minute if you are not familiar with crontab which is still followed through the documentation of crontab will understand for this this this is very clearly what I am doing here I am just sinking from s3 to HTML directly every minute so what role during this will be our user Apache hand in command a command will be yes Esther st. and what would you think here that is let's put this delete now what I need to sing here there to be as through the whole bucket name and team I deliver the blue signal and that's it for now let's start the front of here let's [Music] great so let's see the log and you tell the system to - yes for love and then thrown yes so we have got a sink here so let me test some of the sink here so I'll just put this healthy HTML I'll just let see I just rename it - or else do one thing can you create file no here so I will just create a file but sir there is five and I want to create it excluding the documents and then that gave a test thought oops right here so big test dot txt and I know this file here you some document just dot txt and then upload so we have got a test txt and let's see we have got it in here or not let's run around one second as in first after a minute you we got I think and then let's see looking for triple-double ooh HTML and then infer to Alice did you get the test you know okay yeah so that's it the s taken great so let's edit the content once more I don't know it is a wrong turn and that's it you so thank you sing let's see we have got the fire or not yes we have we got it here so that way it will work so we need to lick the test file from here you and subsequently this should be related from here so let's see yeah it's gone so this thinking is working properly now or this I think this is sufficient for to create a mice so let's create the am I here and which creates match and then we will put qt3 demo everything else fine and then pretty much great so still we are getting this the server is up here and still the aim why is it is getting created so that's fine now we will navigate to s3 once more and we'll create a media pocket because all of our medias that should be there in this direction because we are going to use a cloud front so we'll create travel you know two to three internal media and we want some public permission for this bucket so we are actually removing all the private settings for this pocket it's clearly showing that this this can be a public no object so now we will go to the permission and we will go to Pocket polishes and we ask some policies here I'll just copy the policies that is given by iws from my personal pet you here our this will be our pocket name that the tickets we demo in media great so now we will sync the media as is just read it for the our code so let's go to for me once again and the connection is Richie I mean yeah so let's go to cron and tell us here or travel to actually from here as this will be our right node we will do the other way around here so today's average tml and now we'll be working as whatever there will be in the HTML code director that will be sent to our Astra bucket because it is all right note you it's WW assume and then the same thing server will be doing with a media this should be WP contempt and then uploads what we want to do it in media that's good Oh you you test it from here we will go to dashboard in coach Media we'll just artillery filed from here my pictures let's upload this I'll check or astrabacus Twitter this is dumb or not you you so ideally it will be one minute you you you so we have got a sink here and let's see yup so we have got this thing here and let's see whether it has got the public permission or not it's perfect so it has got the public things now what we will be doing will create a cloud front here you and I'll create a new one and this will be the origin domain will be this kill two three demo video this one and then I'll leave it the origin path because for first setup if it is not a static website then you can leave it and everything else is flying here I like to check that's fine so let's script the distribution and it will at least take 13 minutes so hang on for that so in between let's do some selling stuff here so we want to change a permalink that should be our hostname structure like this and we want to save and and immediately you can see htaccess file here and let me call district 3 when when our cloud filters up really to change this htaccess and according to our sinking rule so it should go to s3 also let's check [Music] you yep so we got one htaccess here [Music] so as you can see stan is showing in progress so in between that we can set up our lab balances so let's go to easy too and then first we will create our spelling groups you and this is the ami we have created earlier which is actually getting synced from s3 whatever there will be in the s3 bucket of code WP cold this will get synced every minute so I'll select this I'll select teaching micro throw this and then I'll name it q3 demo a is G that means auto scaling group and the I am role I want this as three full access and then I want cloud watch monitoring and then everything else that is fine now and then I add storage of eight weeks then I want to open SSH web access and for later use I want to open the radius also I'll show you how to do that too to configure our ready sketch which is actually running on port six three seven nine so let's review it and then let's yep so everything else stood and create launch configurations I'll put the same he has my security key here and the launch configuration this will be something let's name it q3 demo that would be I'll see for the launch configuration we want to start with two instances and this will be our in default 50 C and I'll choose all my subnets here subjects are automatically populated when you click here so then now I want for four days we should scale between 2 to 5 and new instances will be kicked off if the average CPU utilization is you know sometimes it's overflowed so you can you can put any target values it'll exit the target value as 1 and then that's fine here we don't want any notifications right now but if you want to create you can put any SS s SS s N and chop topic here and we can put your email here that's great so that's it and then for this auto scaling group I name it name - Q - 3 general yes review and let's find that maximum good-sized minimum which rises to maximum is 5 and so create an auto scaling group but there it is successful and so still no no instances are getting up so we will see some instances are getting off less two instances are very popular so if we go to instances we can see two instances are getting off here so bear with me for some time that will be up so here it is you can see all the artists selling group instances are up here now we will create our load balancers so for the load balancer so just for a test let's see horses the output here so it is obviously I think it is getting redirect Alexei what is the URL 18 to 1 8 to the 7 and here it is 18 to 180 yeah so looks like how the instances are working as we want so let's put it here and then let's create a load balancer so create an application load balancer and from now this will be internet-facing we name it two to three demo uld that is for elastic load balancer it will be interact fishing then the listeners is a suitably eighty port availability zone we want s3 and anything else here I think that is good to go and obviously we want this to settings even the readies to be opened and then we need to create a target group so we will go to create a new target group that should be key to 3 demo TG we name it and then we do it with the instances and as finally we can we can put here healthy god and stream all that we have created there and then thank you put these two instances to the register here okay next everything else is fine so create you so if you go to Target group and then let's see what is the target so statuses initials so exci so well it is getting a request for its statuses we will do something else here that is we want to create a domain things here so we will go to route 53 now I want to create a new ha strict zone that is like a name it kill 2 3 demo sit and and some space of per se invalid characters person limiting key demo you okay so so I want to create a new new hostage zone here the two to three demo at all point rate start from one to wix.com that is fine and in my main demand setting TNS settings I will add all these entries this should be a name server records and should be two to three demo and this points to this then I'll add one more touch you to the demo let me copy this you thank you and then this and last one this beautiful dangle this I split it so let's now create an error codes here should be error occurs and we want to create a liars and this should be our this lvd sutra third my elastic load balancer and then create and very go - then let's go - I say two you let's see what is the status of our target group you and it shows healthy segments are all target groups are working fine so now if you go to here which is our master note we can see that IP is we got 19 dots 7.20 and now let's go to here let's see it has been propagated or not cute little demo on favorites dot-com perfect and I chose the IP address 3 16 to 35 1 3 3 there is actually a load balancer so let's understand it properly that is figure a DNS checker here and if we put this domain all this two IP addresses this is actually our to target group or auto scaling group instances that is routed through the load balancer okay so and this is you know this is highly reliable how it is reliable I I will show you on similar liking part here let's say I am just trouble eating this and strands let's say for any any char of any sort of miss happening at this instance is getting corrupted or these instances getting down so if I terminate it and let's go to we're always killing groups and here it is so another instance has been kicked off and this is terminated I manually chop my network in back of our auto scaling group has started another instance so it is highly reliable if one of the instances is failing then aw the scaling group is responsible for rescuing go up okay so now going to stay here still you can get your website up so now we are appending with the cloud front set up here so let's see what is this a stateless here it is showing the step light so now let's go to here and to explain here first we need to make the htaccess a little bit Cho modified so configure yet and then we don't leave this line because we want everything is you and I will put my Dominion here for the cloud front I should with this and so yes that's it work related to forget it to all our instances it will take a couple of minutes and so now let's go to our site and then refresh we are getting some errors here so possibly who likes likes in inspect the head stick history access here I believe this line should be at last because the index dot PHP rule should be satisfied first before it goes to the cloud from domain so let's put this here [Music] you I think sufficient the good to go yes let's edit this and put the image we got here this image from video library and then selecting it and testing it here update so get it now let's see watch is there and the fine it is there in the master note as well as and the load balancer what is there let's see absolutely great so let's see the network for works there and if we just filter out the images and if you go there you can easily see that it is coming from our s3 cloud front origin there may be some little bit redirection issue this is temporary some people are getting it but it's completely temporary up to Center it's when when the DNS is propagated properly we will get your your image assets URL from doubt from so don't worry about it so this is the right configuration here doing so this is it and let's say we are going to add some plugins to so whenever we will be changing or whenever we'll be doing some admin works we'll always do it from master node let's say we want to put some plug in I said let's go to add new and then we want to put our radius install I'm an activate so this is the radius all chick looks great elastic you can see here let's create it from here and we were going for ready son we named it Q two three demo everything else is fine that's good so again it will take at least 10 to 15 minutes for creating it and we women can say large that is too much so no problem I'll delete afterwards so let's see you so in between we can take a look to our this in q3 demo let's log in here and then go to this and if we go to plugins installed plugins yes here also we can see the rarest plugin has been propagated this IP is 3.16 dot 235 133 there you can see here and if we go to master node this IP is let's refresh this is 3 that 19 duck 7.20 - so we are actually playing with both the load balancers instances and the master instances that is purely gold for any sort of website configuration though let's see or the status of elastic assets still now modifying so it will be up of it in some minutes I believe they shake it one more time yes it is available now just talk to this end point from here and we will go to master and then settings then and I will the object cashier and then water will do again the codes we will edit BB config.php and here we will define something where it you the the readies host and we will test this hope so I have missed it here I sit with this and you don't get the port number as it default let's see and on the under master so if you're showing not connected let's extend this let's go to here and then go to the description and then we can see we have to see the we have to see the security groups here so if we were to here and then modify and let's yes this is this has to be ready here and then modify it will take some minutes so now it is saying I love it here now let's go here and let's check the status yeah so it is connected and now we go to our slave nodes and check the settings there it is also connected so now if you go to here the first time it loads this way and it feels refreshed now it much much faster
Info
Channel: Dave RBJ
Views: 5,399
Rating: 4.7419353 out of 5
Keywords: AWS, Application Load Balancer, Auto Scaling, CloudFront, Redis, Elastic Cache
Id: 5-lTtv3Zlrw
Channel Id: undefined
Length: 61min 43sec (3703 seconds)
Published: Fri Mar 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.