Alright. So now that we've got all that installed
and set up and everything,
what you're going to do is start the Apache 2 service.
So, just type sudo
systemcontrol
start
apache2
And right now, we should just be able to go to localhosts.
on noteport
and we'll see the default Apache2
directory
or webpage.
So, the first thing we're going to do
and you're going to see why. Let me open up filemanager here,
I'm going to show you where, Apache2
serves the files from default.
So, we're going to go on other locations. Computer,
var, so from the root directory, it's going to be var
www
html
This file is the page we see here.
We see that root owns it.
So, if we were to edit the file and save it, we wouldn't be able to.
We have to run everything in sudo or root and that's bad.
So, we're not going to do that.
What we're going to do is we're going to make a few configuration changes.
The first one, let's go with
sudo chown
nick
/var/www
Actually, we need to do that, recursively.
There we go.
Now, let's have a look.
Make sure this went through,
good stuff.
Now, the second change we need to make,
is within,
the configuration file of Apache itself.
So, let's change directory into /etc
/apache2
and we're looking for Apache2.com. So, run sudo nano
apache2.com
and that's actually the wrong thing.
So, we're going to go back to this file later.
We actually need envvars, so let's go to sudo nano and envvars
What we're going to do is change the run user, to our user.
And the run group to our group
control+o
control+x. You actually need to restart
the server.
So, if I were to refresh here,
If we had
any
major changes in configurations,
they wouldn't take effect until we restart.
We'll learn that in the next video,
when we actually set up virtual hosts and whatnot.
You'll see, they won't work until we restart it, So sudo
systemcontrol
restart
apache2
It's going to restart this. Basically, what we've got right now is
the ability to edit this file.
So, the first thing I'm going to do is delete this file.
Now, I'm going to create a new file, so let's go
Let's just open gedit
here for...
actually,
Let's
use nano
So, /var/www/html
we are going to
since we actually have write access in here. We no longer have to use sudo, so.
Just nano index.php
And just to confirm that php is working, we're just going to
do this.
Control+O
That's memory refresh.
Why is it not working?
Let's try this.
There.
There we go. I got a...
I forget sometimes with php how the info
command is written. I think it's
I think it's just this actually.
And so, if I refresh. Yeah ok, so there is no underscore. For some reason
I keep thinking there is an underscore in this. So, everytime I do this,
I always try once, fail once
and the second time I get it.
So, this is the output of configuration check I guess
for PHP and the server itself.
It will give you all sorts of information
about PHP and the server
and the environment and whatnot.
So, that's a
how to setup PHP,
mySQL and
Apache, it's
I don't know, like, people think it's this huge thing to be able to
configure a server. And really it's that simple.
You just install a few packages, start the service and you're good to go.
In the next video we'll be going over some
mySQL stuff and advanced Apache2 configurations stuff and
that's about it.
Thanks for watching this. I hope you guys managed to get your own
webserver set up with this video.
Thanks for watching and I'll see you on the next video.