Hello, and welcome to this presentation from Pluralsight.
My name is Andrew Mallett,
and I'm going to be your instructor as I help guide you
through the module where we take a look at implementing
HTTPS with the Apache web server.
Now it's about time you got yourself comfortable deep
down in that chair with a big warm cup of coffee or
whatever your favorite beverage is, and we're going to begin.
As we work our way through the module, we're going to be taking a look,
of course, at securing our Apache web server,
and we're going to do that using HTTPS.
We can begin by installing Apache2, and this will be done on our Ubuntu system.
We'll be taking a look at how we can set up name
resolution and how name resolution works,
particularly on our Ubuntu system where it uses the
systemd‑resolved for name resolution by default.
We'll be creating ourselves in this module, a self‑signed certificate.
Now, this is the quickest and easiest way of doing it.
It's not necessarily the best,
but it's one way to get HTTPS up and running and take a look
at our SLL configuration within Apache.
Later on, we'll take a look at creating a certificate authority,
but that's not in this module, it's the module to follow.
We'll be seeing how we can work then with that self‑signed
certificate within our Apache configuration site.
When we're using Ubuntu,
we have site files and those site files then can configure both the
default site and new sites that we want to add in.
We'll look at the directives that we need to add to the Apache configuration.
To ensure that this really is secure,
we don't want people going to our default HTTP site.
Now we could go through and disable that,
but we could also redirect all HTTP requests to HTTPS on port 443.
We'll look at how we do that to ensure however you access the site
it is going to be via a secure HTTPS connection.
Now I think I've already mentioned that we're using
Ubuntu 20.04 for these demonstrations.
We're running Vagrant, a virtual machine manager and underneath,
we have VirtualBox.
Now these are just our suggestions,
it's our suggestions because these are free and open‑source
software that is available on Windows.
macOS, as well as Linux.
So it really becomes a good choice if you are able to use it.
Now first off, we need to install Apache.
So I'm going to raise my privileges,
and we can then go through and do an apt update to make sure that we've got
the up‑to‑date metadata for our package management system.
And then we'll be going through and installing Apache2.
I'm also just adding in a command line browser so I can easily
then demonstrate the access to the website.
Within Debian‑based systems, when we install a service,
in general, that service is going to start automatically.
So we don't need to worry about starting and enabling
the service; it will be running.
But when we take a look at it,
we're going to be able to see that is open on port 80,
our HTTP port, but not on HTTPS, and it's that that we're looking at enabling.
To be able to use HTTPS though,
we will need to be able to access a valid hostname.
Our hostname is going to be assigned to our certificate,
and we need to make sure that we're accessing the same
hostname that is stored within the certificate.
Next up, we're taking a look at hostname resolution on our Ubuntu system.
If we try pinging the hostname, my hostname is Ubuntu,
we're going to be able to see that it is resolved.
It's going to be resolved by systemd‑resolve,
but we're not necessarily going to know that.
The way to find out is to take a look inside of our host file.
When we look inside that host file,
there probably isn't an entry for the hostname ubuntu.
When I go through and dig ubuntu though,
this then gives me a little bit more information,
and it shows me from where the hostname ubuntu is being resolved.
And I'm going to see that it's from a DNS server running on our localhost.
It actually gives the address of 127.0.0.53.
Now, of course, then that makes the hostname ubuntu available on my local system,
but, of course, other systems won't be pointing through to this DNS server.
But the name ubuntu being resolved on our localhost is good enough for this lab.
If you're using a different system and it doesn't have this set up,
just make sure you've got an entry in your localhost file that
is pointing through to your local IP address.
We're also going to look at how the server name is
affecting our Apache configuration.
By running the apachectl configtest, as the name suggests,
it's a configuration test, it will give me a warning.
Often, in fact, nearly always, unless some configuration has been changed,
the server name directive is not going to be configured in the default site,
so it's going to give me a warning.
Now it's not going to cause me problems,
but as we go through, we're going to be looking at fixing this up.
But this is enough talking about what we're going to do.
I think it's very important that we get some hands‑on experience because
that's really where our learning journey is going to begin.
When we start doing stuff for ourselves and I do emphasize the term we,
not just me demonstrating to you, oh no, you are going to join me in this journey configuring your own systems.