HOW-TO: Apache2 SSL Certificates using LetsEncrypt

From Tayledras
Jump to: navigation, search

Installing LetsEncrypt

# Install Ubuntu Repos
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update

# Install Packages
sudo apt-get install certbot python3-certbot-apache apache2

# Verify Install
sudo certbot --help

# Obtain SSL Certificates
sudo certbot --apache

Requesting and Setting SSL Certificates

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: kenforeman.dnsdojo.com
2: tayledras.dnsdojo.com
3: ares.foreman.home
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1 2
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for kenforeman.dnsdojo.com
http-01 challenge for tayledras.dnsdojo.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/wiki-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/wiki-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/wiki-le-ssl.conf
Created an SSL vhost at /etc/apache2/sites-available/wiki-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/wiki-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/wiki.conf to ssl vhost in /etc/apache2/sites-available/wiki-le-ssl.conf
Redirecting vhost in /etc/apache2/sites-enabled/wiki.conf to ssl vhost in /etc/apache2/sites-available/wiki-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://kenforeman.dnsdojo.com
and https://tayledras.dnsdojo.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=kenforeman.dnsdojo.com
https://www.ssllabs.com/ssltest/analyze.html?d=tayledras.dnsdojo.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/kenforeman.dnsdojo.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/kenforeman.dnsdojo.com/privkey.pem
   Your cert will expire on 2020-09-12. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le