In this lesson we'll be securing each of our domains with SSL using Let's encrypt let's encrypt is a
free easy to use SSL certificate that can be installed within a few simple steps.
Back in terminal we need to install the cert bot software on our server to do so.
Type in the following command once you've finished typing in this command press Enter
press enter to continue.
Now install cert boughts Apache package using the APTA method.
So Type in this command and press enter
type in Y at the prompt.
In order for cert but to automatically configure SSL it needs to be able to find the correct virtual
hosts file for each domain in the Apache configuration.
Since we already set up our virtual host directives we can go ahead and obtain our SSL certificates.
There's actually two ways of doing this.
Typically if you already have your domains configured you can register a certificate for all the domains
at once and the syntax for this would be as follows.
As you can see we have each domain name including its w w w prefix in the command line.
So each domain name is precedes the dash d Flegg.
And so if you had five or 10 or however many domains you could plug them all in at once over here to
save time.
However most of the time you'll be adding certificates periodic as you register additional domains or
take on more clients.
In the case where you're running a hosting company.
So for this reason we'll register each certificate separately as you would normally do in the course
of business.
So let's go ahead and start with our first domain.
You're going to type this command here.
You're going to replace example dotcom with your Doumit with your first domain name
once you finished that double check that you've entered the correct domain name.
You don't want to make any mistakes here.
And go ahead and press enter.
Now it's going to ask you for an e-mail address just for administrative purposes so you can go ahead
and enter that in
you have to agree to the terms of service so type in eight and press enter.
Now it's asking if we'd be willing to share the email address with the Electronic Frontier Foundation.
I'll just go ahead and select no.
This is an important question.
It's asking do you want to redirect all requests to the HTP version of your web site.
Now typically you do want to do this if somebody types in w w w dot your domain dot com or types in
your domain without the W.W. prefix.
Whatever the case may be we want all requests to redirect to the HTP s version of our Web site if for
any reason you don't want that then you're going to enter one here and press enter.
But if you do want that you're going to type in to and you're going to press enter.
OK so perfect.
As soon as you finish that the congratulations method your certificate and chain have been saved at
and then it gives you the directory and file name in a second.
We will upload our domain on our in our web browser again just to make sure that it is secure.
Make sure that the SSL lock is present.
But before we do that let's go ahead and create the certificate for our second domain as well.
So again you're going to use the same command
and press ENTER
since we've already configured the administrative e-mail for our server we don't it's not going to prompt
us for that again.
All we have to do is decide whether we want to redirect all traffic for this domain to the HGP version
of the site.
So once again we do so when enter to and press ENTER OK perfect so we now have both our certificates
installed for each separate domain and all we have to do is test to make sure that it's working.
Since we're accessing the first domain through a proxy service the secure message here that is not relevant
to our SSL certificate for the first domain.
We will have to wait till the DNS propagates in order for us to view our SSL certificate over here in
the secure message area.
But since our second domain works we can certainly test that out and you can see over here that it is
labeled secure.
And that means that our certificate is valid and you can see here that it's issued by the let's encrypt
authority so everything is in order.
So I just tried the first domain again in case it has propagated perfect.
Ok so now it has propagated.
So it took probably around 10 minutes.
So sometimes it's fairly quick.
And you can see that the first domain is secure as well
here's the certificate again issued by encrypted authority.