 Everybody this is Brian and welcome to the fourth lamp tutorial today. We're going to be discussing installing lamp So the first thing you want to do is open a terminal if you're wondering how I did that just press control alt and T Or you can actually do the long way go into the dashboard and type in the word term for terminal And you're going to want to do a sudo or switch user do apt get install Tassel now if you're new to Linux this probably looks like a lot of jibberish. Let's explain it super quick sudo or switch user do apt get aptitude get that's a package installer basically we're telling it to install the package called tassel Gonna hit enter give it the password for your root account Which you gave it when you set up now all this stuff. Don't be afraid It's just saying this is what we're gonna do and what it's saying is we're gonna download these things install these things And it's gonna take you know 9,859 kb of disk space so just hit yes And it'll download and install everything Now with everything installation this may take a few minutes and I may pause the video in a few spots Testing a new recording software called record my desktop actually seems pretty robust So I'm kind of liking it so far Kazam worked really good, but it just kept crashing on me I don't know what the deal was so I would get you know halfway through a 30-minute tutorial and then just realize Oh, I haven't been recording the last 20 minutes of it kind of a bummer All right. Anyways, the reason why we're installing tassel is It makes installing suites of packages Is that the right term suites of package or collections of packages very simple and lamp is a collection of packages It's Linux Apache mysql php well, this will give us the option in Very few keystrokes to install the whole thing rather than going out to Apache.org and mysql and you know Downloading and meeting directions and installing. I like simple. I like fast. I like easy All right, so we're gonna give this a few minutes to install All right, we're back As you can see here, we are done installing now we're gonna need to type a command sudo Whoops test cell don't know what that loud thump was I hit the tab key for autocomplete and I forgot my main speakers are still on Now why am I showing you all this on a command line? Wouldn't be easier to do it by a GUI? Yes, it would but here's the thing if you're installing lamp on a server You can't always count on a desktop actually being on the server most Linux servers simply just have a command line after we sudo test cell Wait for it to think real hard. There we go Now as you can see there are a lot of options here You simply use the up and down arrow keys to move up and down through this list And you can see there are a lot of options really. We're just concerned with one lamp server highlight lamp server hit the space key Then hit tab to go to okay, and just hit it the inner key This brings up a a quasi graphical interface back from the old command line days And this makes the whole process much much easier. I mean what it's doing is it's going out. It's downloading a patch It's downloading my sequel downloading PHP. It's not really true. It's already bundled together, but it's downloading all this stuff It's installing it configuring it all the work's done for you What this is saying is it's not mandatory, but highly recommended you change the root password for my sequel My sequel is the database component of this. It's how data is stored So if you want to make like an online store and you want to have products and stuff like that my sequel Where is where all that information is going to be stored? So you're going to want to set a password for this I would recommend using a rather complex hard to think of password But it's something you're going to have to know and remember For this I'm just going to use the word password my highly top-secret complex password for a virtual machine It's going to say repeat it and it's going to start installing everything here I'm going to just let this run and once it's done. We'll resume recording All right, it looks like we have just finished installing So if you've come back and you see this it looks like everything went fine Otherwise you see a big a big error message on your screen so lamps installed or Is it I'm just kidding now what we need to do is actually verify everything installed correctly First thing we're going to do is we're going to restart Apache Because we just did a lot of configuration on the system We want to make sure the web server is actually functioning correctly before we test it So we're going to go sudo Etsy and it D whoops patchy to whoops Restart now what that command does let's examine this sudo etsy is a directory and it D and then Apache to Apache to that's actually not Apache. That is a script and That script is specialized for helping you with doing things such as restarting the service or I should say the Damon Sorry, so we've just restarted Apache and it'll tell you whether or not anything horribly bad happened It is just saying could not reliably determine the servers fully quantified domain name Well, we don't have a fully quantified domain name. We're just running on localhost 127.0 to 0 to 1 or in this case 1 1 And it's just going to give you a status right here. Okay, we know that everything worked pretty good So we're going to open up Firefox or whatever web browser you have And while that's thinking we also need to navigate to the actual directory and see what's going on here Like I said, this may run a little bit slower because I am on a virtual machine And if you're running this all in the same box, you just type in 127.0.0.1 That's your localhost and if you see this screen tada, it works. That's the Apache it works page Now where are your files located? Here's your file system? and remember Slash or root is the root of the file system on a Linux. We want to go to var var or Var some people call it and www or dub dub dub And you'll see index dot html. That's the actual file that you are seeing displayed here Now you can't just go in there all willy-nilly and try editing it because the permissions are different This directory is locked down so that your specific account can't go in there and do anything fancy for example, if we do Text for text editor, which is actually g edit bring this up And let's just open that document And we think we're pretty special now because we got this document and we do a whole lot of work I mean hours and hours and hours worth of work on this thing and Well, we can't save why? Because we don't have the permissions to save so what you need to do is back out of that And if you try to save it, we just won't let you save somewhere else so we're gonna close without saving and Our trusty sudo and open this up now you can save And when you go back to Firefox and you refresh you'll see this is my code what we just typed in So we know Apache works now. We need to test you guessed it PHP So what we're gonna do here was gonna go back in here We're gonna make a new file if you don't know what that is that is the start of a PHP tag and The end or I should say start of a PHP block in the end of a block and we're just gonna say PHP info to brackets and semicolon and Don't worry if you don't know what any of this stuff is. We're just gonna save this file And we're gonna call this test dot PHP Notice how the colors changed because now syntax highlighting is happening within g edit Don't worry as these tutorials progress. We're gonna get a much beefier IDE going on here right now We're just testing everything so we'll do slash test up PHP and Ta-da, there's our beautiful PHP version All of this that you're seeing on the screen is outputted by that PHP info function that we just typed in Like I said, you don't need to understand what this does just yet You don't even need to understand any of this. This is simply just to test that PHP is working Now that we know we've got a patching PHP working. We need to test You guessed it my sequel, but we're gonna do that in the next tutorial because it's a little bit more involved Anyways, this is Brian. Thank you for watching. I hope you found this tutorial educational and entertaining