Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barrouh/53876b13999f4d65a7b3d242635360de to your computer and use it in GitHub Desktop.
Save barrouh/53876b13999f4d65a7b3d242635360de to your computer and use it in GitHub Desktop.
Secure Apache HTTP Server with Let's Encrypt on on Ubuntu Linux

Secure Apache HTTP Server with Let's Encrypt on on Ubuntu Linux

Let’s Encrypt is a Certificate Authority (CA) that facilitates obtaining and installing free TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. It simplifies the process by providing a software client, Certbot, that attempts to automate most (if not all) of the required steps. Currently, the entire process of obtaining and installing a certificate is fully automated on Apache.

Configuration

Installing Certbot

sudo apt install certbot python3-certbot-apache

Allowing HTTPS Through the Firewall

sudo ufw allow 'Apache Full'
sudo ufw delete allow 'Apache'

Obtaining an SSL Certificate

sudo certbot --apache

This script will prompt you to answer a series of questions in order to configure your SSL certificate.

Verifying Certbot Auto-Renewal

sudo systemctl status certbot.timer

Test the renewal process

sudo certbot renew --dry-run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment