Skip to content

Instantly share code, notes, and snippets.

@nanusdad
Last active September 25, 2023 06:07
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 nanusdad/52b274cabdc0d1e0a073e8b0017395bc to your computer and use it in GitHub Desktop.
Save nanusdad/52b274cabdc0d1e0a073e8b0017395bc to your computer and use it in GitHub Desktop.
Setting up LetsEncrypt SSL certificate for Moodle on Ubuntu

Setting up LetsEncrypt SSL certificate for Moodle on Ubuntu

  1. Install certbot

sudo apt install certbot python3-certbot-apache
  1. Enable firewall to allow Apache https and ssh

sudo ufw status
sudo ufw enable
sudo ufw allow 'Apache Full'
sudo ufw allow ssh
sudo ufw app list
sudo ufw status
  1. Change ServerName in /etc/apache2/sites-enabled/000-default.conf to DNS names.

(update other Virtual server configurations if multiple DNS alias are required)

  1. Obtain LetsEncrypt certificate (answer prompts according to requirements)

sudo certbot --apache
  1. Restart Apache2

sudo systemctl stop apache2
sudo systemctl start apache2
  1. Check and set certbot timer

sudo systemctl status certbot.timer
sudo certbot renew --dry-run
sudo systemctl status certbot.timer
@doraemonxxx
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment