How To Secure Apache with Let's Encrypt on Ubuntu
Step 1 — Installing Certbot
To obtain an SSL certificate with Let’s Encrypt, you need to install the Certbot software on your server. For this tutorial, we’ll usethe default Ubuntu package repositories to install Certbot.
Run the following command, which will install two packages: certbot
and python3-certbot-apache
. The latter is a plugin that integrates Certbot with Apache, so that it’s possible to automate obtaining a certificate and configuring HTTPS within your web server with a single command:
Confirm installation by pressing Y
and then ENTER
to accept.
Certbot is now installed on your server. Next, you’ll verify Apache’s configuration to make sure your virtual host is set appropriately. This ensures that the certbot
client script will be able to detect your domains and reconfigure your web server to use your newly generated SSL certificate automatically.
Step 4 — Obtaining an SSL Certificate
Certbot provides a variety of ways to obtain SSL certificates through plugins. The Apache plugin will take care of reconfiguring Apache and reloading the configuration whenever necessary. To use this plugin, run the following:
This command will generate a prompt with a series of questions to configure your SSL certificate. First, you’ll be asked to provide a valid email address, this is for the purposes of renewal notifications and security notices:
file upload method with www
sudo certbot certonly --agree-tos --email admin@dinpl.com --manual -d dinpl.com -d www.dinpl.com --server https://acme-v02.api.letsencrypt.org/directory --manual
wildcard
sudo certbot certonly --agree-tos --email admin@dinpl.com --manual -d *.dinpl.com --server https://acme-v02.api.letsencrypt.org/directory --manual
Comments
Post a Comment