So now what we're gonna do is set up a wordpress installation on top of our
Apache 2 environment
and so the first thing that we're gonna need to do is actually go grab the
wordpress
zip file from wordpress.org
and then we can extract it and put it into our html directory.
So,
just go to wordpress.org
and click Download WordPress.
You might have a different version here if,
if you're watching this
you know off in the future
somewhere.
Once it's complete,
just open up your
file manager
and it should have gone to downloads
and just right click it and
extract here.
And when we go in here we want to make sure that we're copying
all these files and actually the,
the directory containing all these files so I'm gonna
copy this directory here that I just created
and I'm going to go to Computer,
my var directory www
html and I'm gonna drop it right here.
Now we need to create a virtual host for the wordpress
directory.
So,
let's open up
terminal
and let's
go into
our apache2 directory
sites-available.
Now,
first thing I'm gonna do is enable a module
so that
the WordPress
installation will be able to use
pretty URLs or permalinks.
So,
we need to enable
mod rewrite and how we do that is
through sudos
or through Apache's a2enmod command so sudo a2enmod rewrite.
I've already got it enabled but you guys should see a confirmation there.
So, now let's create our virtual host for our wordpress installation so
sudo nano wordpress.conf
and as always we open up the virtual host
and we close it down here.
Now we need to give it a server name
and so we're just gonna use wordpress.localhost,
localhost.
And
most of Apache is camel case by the way so there's
capital letter at the beginning of each word
in a directive
and so ServerName right here that's a directive.
Think of it like in programming if you set a variable.
That's
essentially what's going on here except it's not called a variable, it's called
a directive.
So,
the next thing we need to do is set the DocumentRoot.
This should look exactly the same as it did in the last video,
we're just gonna point it to a different directory.
And now, we actually need to configure
some things. So,
open up a directory
element
and just put a forward slash here so we're gonna configure
the
root Directory first
and we're gonna put Options
FollowSymLinks
and then
AllowOverride All.
And then we need to configure the directory of a wordpress installation
so,
and then close
that directory on it down here.
And so we're going to allow it followsymlinks,
we're gonna allow it to override URLs and we're gonna
basically order allow and deny in so,
I'm not gonna go over to much of what all of these does
but this is the basic configuration for
mod rewrite
in a virtual host.
So,
Options Indexes FollowSymLinks
and we're actually also gonna add an option for MultiViews as well.
Down here we're gonna type AllowOverride All
and then Order allow,deny
and finally allow from all.
So this is going to make sure that htaccess files
work in the rewriting and we'll have a look at the
custom htaccess rewriting here in the next few videos somewhere.
So,
let's save this
and then exit
and also enable the site sudo a2ensite wordpress.
Now we restart Apache
using systemctl.
Failed.
Let's
have a look at why it would fail.
So systemctl status apache2.service,
we must have got something wrong.
Invalid command 'Optons' interesting.
C
Op
Okay I think that was the only issue there.
Let's try restarting again
and we're good to go.
So, let's
go edit our host file so
sudo nano hosts
and we're gonna create
another redirection here internally to our system
and this is gonna be wordpress.localhost.
Save and exit
and
then we should be able to go to
wordpress.localhost
and start setting up
the server.