All right, everybody, welcome back to another third Cup series.
This is a certified Kotlin Tester module on installing lamp on Kelly Lenox.
Which LAMP stands for?
Linux, Apache, my studio and PHP.
This is our.
Table of contents are outlined.
We're talking about what makes a web server, what exactly is a lamp stack?
We're going to talk about components of a web server.
We'll get into installing Apache, installing my SQL Server.
We'll get into installing PB and node JavaScript and being able to run your first web page as well from
the local machine.
This is our flow.
Start off with the web server.
Material will work into installing each of the components in series.
So what is a web server?
The programs that run over the web request, the server files which create web pages to users and respond
to requests.
So the response gets sent through a computer's.
Internet connection.
And that's usually done over HTP or HTTPS.
There's many kinds of web servers.
Generally, we're using Apache if it's on the Internet.
If we're talking about Microsoft Windows, then there's Internet and information services.
Or I guess an Engine X is one of the new players that's designed to.
And to try and be a direct competitor to Apache.
The Web servers often come as part of the larger part of the Internet, and their protocols and platforms
are how we get things like email, how we pull down websites, how we watch videos online.
We stream media.
That's all done.
From Webster's.
So let's talk about a lamp stack.
So a lamp stack is really a set of open source software that can be used to create websites.
So each component goes together to form a platform.
So you have a Linux operating system like calling Linux or Ubuntu or through say Linux or CentOS.
Then you typically have the Apache Web server and then you have the open source.
MySchool database school stands for Structure Grade Language.
It's a relational database system, which means that there's tables of information that have relations
to each other.
And my school is just one type of relational database.
There are others like PostgreSQL.
There's Microsoft, Zico and many others.
And then lastly, we have the programming language that lives on the top of the web pages and the web
server.
The Web server usually has the old days of web 1.0 content was largely static read only things.
You would go out to a web server, you would make a request, and the server would send back the information
a short time later.
So now if you think about the Web, the way it works today, we have Gmail, we have Dropbox, we have
YouTube, we have Facebook.
Everything interactive on the Web has to go through some type of Web server.
So the web server has typically a Linux kernel.
It has some hardware that it runs on and that.
Colonel will have various components like the firewall, maybe SD Linux.
A network interface card and then of course different kernel modules and then you'll have the web cache,
front end like squid or something like that.
And that web server will that will be serving up the web page and then there'll be a scripting language
like Perl, BHP or Python.
So lamp can mean many different things, but.
It kind of works very similarly to other implementations.
So what are the components?
You've got your Apache Web service, your web language.
So set it the application layer.
Then you've got your hosting, your your firewall, your IDs.
And lastly, your operating system.
So let's look at installing Apache on Linux in our case.
We've already got it installed, but we'll go ahead and go through the process.
Go ahead and log in here.
And we would do a pseudo war already route.
Afghans are patchy too.
We'll see that it's already installed.
We have 2.4. 43.1 version installed.
And of course, you want to make sure that your system is fully up to date.
So you want to do a sudo apt get update as well.
Way to make sure you have all the latest versions of the software from the various repositories.
Even.
In a short amount of time.
A small update there.
So let's go ahead and clear the screen and we're going to go ahead and start the Apache two service.
Let's check on the status and make sure it's actually running.
And there we go.
We can see that's in fact, running.
So if you want to start or restart or stop the server, you can do this command service restart.
Our knowledge.
That's the name.
And you can do.
If I could type properly we would get this done service Apache to restart and then okay we close the
screen again and let's do service Apache to stop.
And notice we can press the up arrow.
We can see the status and see that it's loaded, but it's currently inactive or dead.
So let's go ahead and start it up again because we want the website to run.
We want it to be a and well.
And let's open up a web browser.
Anyone to go to that local house for Haiti.
And so we're going to see.
That our first Web page is going to look something like this.
You had minimized this.
Go to our web browser.
In this case, we'll just go with whatever the default is.
The local host call an 80 and there's our default Apache page.
Obviously some information about where the the location of the files are at.
We can see that Apache has the Web pages in the bar slash that we did every day.
So let's go ahead and change.
So this is where your websites are going to go.
So right now it's serving up the index that HDMI out, which you can edit with a text editor or you
can edit it with other things.
But this is the page that it's currently serving out.
Go ahead and close this.
All right.
So obviously, if you want to change that.
You have to do either creative change or you could actually take that page out if you didn't want it
to be shown at all.
So now we have a functioning web server.
So let's go ahead and install my SQL Server.
So we're going to open up the terminal and clear the screen again.
Let me go ahead and zoom in a little bit more.
So it's a little bit easier to see.
Right.
All right, go.
We don't need a pseudo going change back to the home directory.
So Afghan install -12 dash server and that server is not available but is referred to by and in the
package now.
This does happen from time to time.
So what we'll do?
So go ahead and go to our.
My sequel.
Documentation.
You can always go to one to.
You can actually go get a fresh copy of my school.
You can build it from source.
But the recommended way is to get the repository.
So you can get my single workbench if you want the client libraries.
So you could do.
An apt yet build dependency of my SQL Server.
Or you could just download the the file the binary straight from them.
It is.
Possible to work with the minus.
So in newer versions of Cowley and also one to us while they started replacing last school with Maria
Deeb.
Which is actually a fork of my ask you all.
So let's go ahead and do App Desk and install red web server.
The command is basically the same thing, but it's going to download in my ask you all database and
we now have the server and since we have the server.
We can go at.
Do a start up.
My school has something called the secure installation.
Essentially, it's not mandatory that you set a password for the user for start out, but for security
practices you definitely want to do that.
So let's go ahead.
And you look at the start menu.
And Kelly, if you go down to usually applications and under system, there's actually a.
Usually that's where the sequel would be, but in the new version, they've changed it and they've actually
replaced that in in a school like database browser.
So if you want to look at databases like those that would be stored on.
Mobile phones or things like that.
But.
You know, for the sequel database, they'll have to just work with.
The my cycle service is actually stopped right now.
So we're going to go ahead and do service.
We're going to go ahead and start it.
And we see it's now running.
It's actually doing some tasks.
This is the sequel.
Service.
Which is actually running from the R&B database.
So what we can do now, now that we have our we have Linux, we have our Apache, we have our my ask
you out now.
We're going to get our PHP set up.
So we're going to do a Sudoku first.
Let's go ahead and check the latest version of free on the website, because it does does change periodically.
So it's always good to get the latest version.
And so for free, generally, you have to it does not show up in the national repository.
So I'm going to say 7.4, which is the latest.
And it actually does show up in the repository, if just by for some reason it doesn't.
Then you might have to actually add the pre repository.
But if for some reason it does not.
Get updated.
If you're on an older version of Kelly, you may not have this option.
And you might have to add the.
Trusted packages are appropriate in this case, we add.
So we're going to go ahead.
Yes.
And we'll let that go through and do its installation.
It's created some configuration files.
And then once we're done, we're going to verify that GHB is actually installed.
So free dash version, we could see around 7.4, 0.5.
And we can also add modules to it if we need to.
Let's go ahead and go look in the order that we have a HTML folder and let's see if
the PHP info page is there.
So we're going to go ahead and basically create a free info file in this directory, sort of like you
do nano or we can -- whatever info dot P of course from respective.
This is not always a good practice.
So we're going to go ahead and put this on here anyway.
We're going to call B, I call the B info.
Function for the semicolon to close off the function.
There are going to be the question mark and agree to that sign.
And they are going to.
Write this out and vote up PHP.
Now we're going to exit and now we've got our info file there.
So what we can do now?
The fee actually stands for hypertext preprocessor.
So that means that it can.
It's an HTML embedded web scripting language, so you can insert CHP code into the website and have
it do interesting things.
So in most cases you're going to want to modify the way Apache serves up files when it requests directory.
So we can type the following command.
And then below the screen so you guys can see this.
Want to go ahead and do Nano at the Apache two?
That's where Apache two folder is located.
Was enabled slash the air ducts.
And now we're gonna go down here and we're going to make sure.
That we have added the index stop up to the beginning of the file.
So we're going to add index up right here and we're going to write this out of file and they will know
we're going to exit.
So now that that is done.
We're going to have to restart the Apache Web server.
So for that, in these few other few options, we give you system CDL restart Apache two.
Or we could have done the Apache controller and restart the service as well.
So let's go ahead and do so for just a refresher.
This is the Apache controller, so we want to start the Damon or we want to restart or stop.
We can do that as well.
So Apache controller status and we can see the browser not found many to install a package providing
the browser or adjust the Apache links.
Very slow systems CTL status.
Apache two.
So we see it's currently loaded and running.
Let's also look at PS status.
I see that the fee.
Service is not running just yet.
Let's go ahead and look at service status, that's all.
Now we see apache is running.
The Cron tab is running network manager.
We have no.
It's free service.
So let's come back to that in a moment.
And we also verified that our PSP is actually running as we were able to go to the browser and we put
it on localhost slash info, not happy and we can see some information about our PHP installation.
This is a lot of valuable information.
And we can see the Apache Hammer is, in fact, configured.
We can see the number of connections as well as the people I've.
So let's go ahead and stall no JavaScript.
So we can do it with Curl.
If it is not.
Well, let's go ahead and minimize this screen.
So no JavaScript is required, not recognized.
You can do the curl command if you want to.
There's multiple ways to get things in Linux as we've already seen, so we're going to go ahead and
install this.
The screen.
Now that we have the programming language installed.
When I go ahead and run a quick update.
Make sure everything is up to date for you forged and make sure there's no errors.
And just to be thorough, we'll go ahead and do it.
We'll do it the way of colonel as well, just so you guys can see that.
I'm going to talk about the in that much, but it is a very useful and important command for Linux.
And we're in a pipe that to.
Pseudo ashy ash.
Says No JavaScript 11 is no longer updated to support version.
So our most likely on version 12.
So let's go ahead and.
Switch that to version 12 and there we go.
Should get no error this time.
So it's doing some things in the background, going out to the county repository, looking at the sources
doubtless file.
It's confirming that our new operating system is actually supported.
So it said run sudo app yet you install so go ahead and run it this way it's.
And it's going to tell us, most likely that it's already installed.
But there are some few extra updates.
The Nazis want to install the package manager.
We're not going to.
Not going to mess with that.
So that's already done.
And now that we've done that, we can do no dash version.
Go look at the server side JavaScript runtime.
So we have version options.
We have a lot of different options here.
With this, we're not going to worry about too much, but just be aware that these server side technologies
do have a manual page as well.
So.
We're going to go into.
So the next part.
That's what I was gonna say.
We have all won 18.1.
And we're going to go ahead and restart our Web server service.
So once we set the server name, DirecTV's presses me.
That's that's fine.
All right.
To go back to the web browser.
And we're going to reload.
And folks, HP.
And we have this time the Apache here, and we also have the Apache environment, and we have some more.
Some more information.
Down here now.
We have my sequel.
They have a lot of different options here.
Even have.
Jason.
Various different credits, additional modules, anything that you might need to install.
Then there's licensing information down there as well.
Double check the version one more time.
07.40.5 for the command line.
And we're going to go ahead and.
We've done that part and we've got the service now running.
And we have successfully gotten our first web page on Kali Linux.
So in summer we talked about setting up programs that use Web services, web browsers to add Web pages,
to serve up requests.
We send things over.
HTP Web servers usually come as part of a larger package of Internet intranet related programs serving
up email downloading requests, things like FTP building and publishing web pages.
Obviously, you're going to want to make changes to Apache like we did because Apache usually looks
at a file called Indexed Page HTML.
We want it to prefer PHP.
So we had to look for indexed at first.
And then we have some practice questions.
So question one Where is the default location web server directory in Linux?
Is it in var HTML?
Is it in Bartleby?
I mean, let me ask.
The amount.
Then the OPPT slash email directory.
Or is it in the ops vase that every directory.
The correct answer is b the var w w w a slash h html directory.
Again, that's where most of your websites are going to be served up from.
So you definitely want to remember that path.
Question two Blank is the name of the default text editor and called lemmings.
We have them have nano mouse, pad and notepad.
Cause the answer is them or the improved version of VI.
Now Nano is another text editor.
You saw me use that you can pick and choose the type of text editor you like.
But Vim is always going to be installed regardless of what flavor of Linux you're working on.
So it's a good one to get experience with and exposure to.
There's also G added, there's Emacs, there's lots of different text editors.
Number three, what command is used to stop an Apache server service.
Apache to stop service.
Apache to reload service Apache stop or service lamp stop.
There's also the Apache controller that the AP, a CHP Ctrl command, but that's not one of the options
here.
So the answer is.
A service apology to stop.
Next question, which is the correct name for the config file for HP?
Or the hypertext processor.
Is it opt out config?
Is it updating?
Peter, I and I.
Or is it p, p, z?
Correct answer is c op dot i9.
Number five.
What is the command used to install?
Node JavaScript applications?
Node dash install.
Node dot JSC dash l npm install.
Or nvm install.
Correct answer is NPM install.
So you want to install JavaScript applications, you have to use the NPM command.
So let's go take a look at that real quick.
Now you may see questions sometimes that we did not cover, and that's okay.
That's why we're covering them now and we're going over them together.
So and PM is the as quick help you can look at different usage info.
So if you want to install modules.
Or JavaScript.
You can do.
PM to see what command or what modules are actually loaded.
Oops.
You're right.
Now it's currently empty.
The NPM view command got an envelop package that Jason.
You can publish modules.
Important command to have.
So summarize, we're going to have our Web servers we looked at.
Lamp stack.
We looked at components of a web server.
We looked at installing Apache.
We looked at installing my ask you all server.
We looked at installing HP, the hypertext processor.
We also looked at installing node JavaScript and running at first web page from a local web browser.
There are some important acronyms to remember.
We have the lamp stack, which we talked about the Onyx Apache last year, LP, HP.
We have the my ask you.
Oh, which is the open source relational database management system.
We have a sequel or the structured query language.
We have PHP, which is the hypertext processor, which is the code that lives in the middle of web pages.
And we have an HTML, which is a language.
Or a hypertext markup language which allows us to further it through the use of tags and other things
to put text and render pictures and run scripts and do things on web pages.
You can think of it like a document type language.
And then we have HTTP, which is how the hypertext markup language gets.
Information from place to place or otherwise known as Port 80 or the World Wide Web traffic, the standard
transport protocol or transfer protocol.
Then we have IRS Internet Information Services, which is Microsoft's alternative to things like Apache.
And that is the end of this module.
I thank you for your attention and I will see you in the next module.