Installing apache, mysql, and php on ubuntu 18 04 on amazon aws lightsail

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello I'm Kevin with open source marketing dojo and today we are going to be talking about installing Ubuntu 18.04 on AWS lightsail Amazon lightsail you would should be able to find a video that I really previously but why you should choose lights-out now we're gonna really get into the meat and potatoes this base server is gonna be the one we use for a few different softwares so we're gonna make a snapshot of it when we're done and so I just need you to follow along a little bit trust me a little bit and then you can do a bunch of googling if you need there will also be a link to the step-by-step instructions in blog format for anybody who is looking for it after following through with the video all right so let's pull up my Amazon light sale and we're in Nora T I logged in already against this is clean this is the same account I logged into yesterday in the previous video you just kind of give you a tour of Amazon light so so let's create an instance that I create a Linux instance I'm gonna do OS only now it is a big time-saver to just grab the lamp stack and go so that's Linux Linux over on already I believe this is an Amazon Linux Linux distribution if we go with this this one and they've already got Apache MySQL PHP and PHP myadmin installed I'm not going to install PHP myadmin in this video we'll do that in a separate video what so we're just gonna get going with Ubuntu him no I'm choosing a bun too because I'm familiar with it and that's how you should kind of pick your Linux distribution when it comes to these ones they are all good distributions done a course on Santa ass and I'm functionally capable of working with the RPM package manager and I think it's pretty solid also but I'm super familiar with Ubuntu it's the it's built on the debian flavor it uses the the apt package manager it's just my cup of tea so that's why we're using it I'm going to pick the one where you eat for three months and it's only three dollars and fifty cents u.s. a month if I were to leave it running and I'm gonna call this one lamp - base I'm calling it lamp base because when I create the snapshot it's gonna use this name I don't need tags these tags are so you can sort stuff out and do analytics later and everything else is set up like I showed you yesterday now I am going to change the availability zone which may cause some of what I've already typed into go away no it doesn't I'm gonna create the instance it shows that the Montreal zone because I am in Canada if you're in the States choose the one that's closest to you or closest to your users is technically what you're trying to do depending on where you are what the laws are where you are it may actually matter where your data center is physically located on some levels so just be aware that that may be true and so this is just working its way to being ready and it's running now I'm going to open the SSH window I want to normally do that smile not clear this so that you can see what's going on I'm gonna minimize this for a second so while you look at something I'm gonna networking and it looks like HTTP is already set up so as soon as I set up a cheat did the Apache server you should be able to see what it's functioning and that's that's important if you had this close deal if this was missing you could hang on that port 80 all day and like sail won't let you Amazon's ec2 like the virtual machine won't be on the internet in reality okay so the first thing I'm going to do is going to do a sudo I'm gonna do an apt update and then I have to upgrade I do that every time I Lotus new system because I don't know where it's at and right now this is actually pretty important because not that long ago they discovered there was a security issue with su actually and so I want to make sure I get that upgraded and the way it goes so I'm just gonna minim I don't need to unless this actually I'm excited I'm not doing anything important actually so I'm gonna say yes to this because I just wanted to and so we'll just let that go when that is done installing you know it is a little boring to watch we're going to install Apache and I actually will minimize this let's grab our IP address and I'm not gonna bother creating a static one yet site can't be reached this we're comfortable there's nothing there yet okay I did that so that as soon as the site's up I can just refresh that page and boom we'll have something and so that's why you bad so again look in the description of this video and you will find a step by step instructions with the code that I use in the description or in a blog format because it's pretty rough trying to figure this out on your own without that and pausing the video at every second it's not gonna be your friend and I'm just choosing defaults because I just wanted to just stay functional I typically don't really love pre-existing images and so I would if I'm not going to use the the one that already has the software bundled together I will normally like really try to write down up again we're gonna do a pseudo system I think this is supposed to be control that's kind of what it looks like to me status and apache2 I'm doing this to show you that the service isn't found it's not there alright so then you can get away with doing apt-get install if you want but in 18.04 I just use apt because I so they have to get it's just the newer flavor I guess and so we're going to use to do apt install apache2 yes I do want to this one's pretty fast it's a pretty tight little web server does its thing in badass ways and so now I'm going to press up twice we see that pseudo system controls that I said I'm gonna say that is oh now we have Apache services there and it is running and we see the Apache server up and rocking around right here so I normally install a firewall if I'm instantly it externally but that isn't installed by default in this instance obviously so I don't need to do any I don't need to make a hole in the firewall for port 80 in port 443 is all that that I'm getting in here and so if you have an issue where you can't just reload this page and get what you're expecting I uh I would expect that that's what's happening and you'll have to go find the video that I create in the future regarding that exact issue if everything's working though this is what you should see when you go to the IP of your server so we are up and I'm gonna bring back up me my web-based SSH Council and we're gonna install MySQL server so we're gonna go see you app install MySQL - you know what I'm actually going to do this first so I want you to see it's not there we have it installed say yes and this is a fairly big one um for for what it is so this might take a little bit longer but clearly it's progressing pretty quickly yeah the worst of the bunch was that da pretty similar and that's because this image is probably a little bit older so I had to get a bunch of stuff I mean it's not ancient obviously but it's it's gonna be older whatever ages there probably wasn't made yesterday and so because I already typed this in no check hey look that's what I'm expecting it's all started and then the first thing that I always do after install MySQL server because I do the MySQL underscore secure underscore installation to make sure that the installation is secure I don't know why check my studio dodo and I'm going to press yes and so this is how secure do you want your password to be we're going to be eventually installing my PHP admin you're on the internet the intention is for this to be for production so we should probably go with as strong as we can get so I'm gonna go into it's asking for a new password I'm going to use one so that I use pretty commonly but what I would typically do is I would load up actually I'm gonna do this so I'd load up strong password generator set to 20 characters I generate something like this it's a beast copy it that is not the password of music I'm going to generate a whole new one like that and then I would use that password as the as the password for this so my aspirated password strength is 100 do I wish to continue with the password yes of course it II and then you're probably enough to record that somewhere so that you yes and so basically just say yes to all these and there you go so now you're way way more secure than you were um and that is gonna make you a lot happier with basically what you have I would basically make sure that you do have a strong password I literally generate passwords for everything to use a password manager and a password database that requires me to authenticate against it I only know two passwords and then I have a mechanism for creating 20 character alone passwords that only screws me once in a one but be aware that that is that is the way to keep your password secure all right so what we're gonna do next is we're going to go in and change some authentication rules within my sequel oh and so like I'm saying we need to uh we need to give MySQL a little love so we're going to create a user no I think we're to change the authentication of the users let me just double check and I know I'm going through and this is like I'm scared it's terrible I'm scared but it this isn't that bad and I already know this stuff so it makes it seem hug seem like oh this is so super hard as you like means I don't know if the space matters or not I can never remember in this interface I'm a little rusty probably shows just because you don't type I mean you do but you don't set things up from scratches Shh because you have the flexibility then so yeah we're looking at the Ruth root user here we're looking that it's an auth socket now socket is technically more secure but if we decide that we want to use PHP myadmin it can cause us grief in the future I'm just gonna stretch this bigger and that makes any difference yeah there you go just wanted this not to be broken up in such a weird looking way and so that's what we're gonna change it this next command we're gonna do an alter you use your command and these are just SQL queries you can google any of this stuff sure didn't invert my he in my hi [Music] right that's it once more and there that's what does not satisfy the current policy requirements oh don't I I need to actually give this a password so I am going to I can't clear Lascaux okay so I have to actually give it a strong password I don't want to show that to you because I don't and so what I'm going to do is I'm going to pause my recording I'm going to do this and then I'm gonna bring it back but so you're replacing norm password here with your strong password I just had a moment and so that's all that is okay so that I've changed that I flushed privileges and now if I use the select user authentication string again you'll see that it is now set to MySQL native password that's gonna be something that you don't have to troubleshoot as much when you install PHP my admin the way I do it and so that's why that exists if you type exit now and you try to go into MySQL what you see is that it doesn't work unless you actually do it with the - you user you want and then the password I'm not going to retype my password right now we are going to move on to installing PHP alright so I want the Apache to library mutlaq mod library for PHP and the PHP MySQL library is installed at the same time so you can do multiple installs with apt like I could do sudo apt install PHP sudo apt install live Apache - - MA - PHP 0 apt install PHP - my a scope but I can do them all in one go so I'm going to go install PHP I want to install Lib Pachi - - mod p HP and I want to install PHP - my and if there's any other important libraries you want to include you can do it right here right now sometimes I install extra but we're uh we're not massive push through that this time around so of course the default is yes that's why it's upper case I just press ENTER it's gonna treat it as a yes if the end was upper case it would treated it so no put the Y in because I like to I want you to know I'm choosing yes Waco's then PHP is installed don't know if Nano is installed by default innocence yeah it is so so I'm a nano person and you'll meet vy people but this isn't mine that isn't my gig so i'm use nano no sudo nano / bar / w / HTML / info and we see a blank file let me have a little PHP here and anybody's installed PHP anywhere will know what I've been stalling I would not leave this file uh-huh on my production level server so we're just doing this mostly to prove that PHP is happy and playing fun times for us so control Oh yep that's it all right thanks and now just clear this and now that I've installed PHP I don't think I reset but I know I didn't reset the get patchy server so I'm gonna go through system control CTL restart Apache so this is nice partly when you Vince done a bunch of things sign just status is active running I think that should work so we're here let's put in our info dot PHP file and see if it works it does so we are running PHP version 7.0 on Ubuntu 10.04 but I just want to show you it is here and it's working and so we are ready to do some modifications to this install one the jumps to the top of my head because I want index dot PHP to load before index dot HTML so I'm gonna have to change the Derrick off then we'll do that again in nano nano you do this a whole lot it actually becomes like something that you just know where it is I think but you can always Google these things too right so you got that right we should have this what I'm gonna do is I move you next on HP here and I'm going to I'll put that yep and then I'm going to exit and now I need to restart Apache again another link that to be more verbose for some reason I thought it would be but maybe it's just because I'm in bid Nami installation so often I think they use their own little tool for that or their marker it's set up to be more verbose but by verbose I just mean it tells you I'm stopping this service I'm starting this service and then at this point we can install PHP modules whichever ones we so desire and we can check out which PHP modules exist by checking the capped cache for them so if we just go to do AB set of cache search page P I think that's what it is because we want anything that starts with PHP - I'm gonna just go pipe less then let me kind of bring them up one at a time so there's a whole pile here obviously and you can just install all of them I suppose if you wanted to but I am not so not so fast to do that and curly I don't need any extras that I can think of I'll selectively install PHP modules as I see fit and I'll make sure that I I mention it if I install it in a future video to do something else you need a scroll like through all of them I'm just sort of watching to make sure I'm not missing anything I desperately need this time around and envy string enabled Shh there's certain all right so that's thought into look for in here that I can definitely so there are ones that I meet that I'm gonna end up installing for sure but PHP MV string is the one I'm gonna install right aways here and B string module for PHP thanks for sure want that one some people just do the install but I've got a policy to only install things I'm actually using I expect him to end up running through this video again in the future probably when the next long-term support version comes live and we'll do the vo PS for the new server with the new software at that time those are all the options you see there all I'm gonna do is I'm gonna go to do install HP - and B string maybe if I tend to apt that would be a weakness no no wait go this again yes is this default I hit enter and it just comes to me you could install like I said all of them I'm not going to because I don't want all of them at this point but we are now ready to to run let's just make sure MB string is now here and enabled I might have to go enable it also we should have been there I might have to go back out and in able that um it is not super essential at this exact moment no so we're gonna do one more thing here that's we're gonna create an e index file and that's PHP we're gonna delete the the PHP info file there so the info dot PHP so I'm gonna nano back into here and put that delete and save this because then no matter what I do it's not gonna matter very much sweet blankness so you don't technically need to close out your PHP I'm going to this done but it's not actually essential then interpreter will do it for you and we are now seeing the index file for PHP at that location so then once you've seen into this directory you can just look at what's there by typing LS anyway will remove info.php it's gone already get the same thing and so instead of pressing up and type of sooner you can just use the bang operator which is essentially the same as second one at this time and now we're down to just the index dot PHP and we can exit we now have a lamp stack installed on our Ubuntu server that is ready to be used for the next installation we want to do in the next video I will be doing an SSL certificate and I'll be associated the main name so that should get you to the point that you're now ready to install real software on the server and then in the video after that I will be doing by PHP admin because I think for most people they don't want to create their database through the MySQL command line interface and I can understand that it is uh it is not the most user friendly it even requires me to look up commands sometimes depending on how long it's been stepped on something and there's just more room for error right so if you found this video helpful and you liked it give it a big thumbs up do I see more videos or fall along with this series you for sure want to subscribe and if you are if you're just wanting to know more about us don't hesitate to go to the website sign up for a free account and send us a message and we will make sure that we help you as best you can thank you very much
Info
Channel: Kevin Rundle
Views: 4,448
Rating: 5 out of 5
Keywords:
Id: gBwCtdSrgqs
Channel Id: undefined
Length: 38min 46sec (2326 seconds)
Published: Sat Oct 19 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.