User Tools

Site Tools


ssl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ssl [2021/01/24 16:14] chifekssl [2023/09/14 06:06] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
  
-===== SSH into the server =====+===== 1. SSH into the server =====
  
-1. SSH into the server running your HTTP website as a user with sudo privileges.+SSH into the server running your HTTP website as a user with sudo privileges.
  
  
-===== Install snapd =====+===== 2. Install snapd =====
  
-2. You'll need to install snapd and make sure you follow any instructions to enable classic snap support.+You'll need to install snapd and make sure you follow any instructions to enable classic snap support.
 Follow these instructions on snapcraft's site to install snapd. Follow these instructions on snapcraft's site to install snapd.
  
-===== Ensure that your version of snapd is up to date =====+===== 3. Ensure that your version of snapd is up to date =====
  
-3. Execute the following instructions on the command line on the machine to ensure that you have the latest version of snapd.+Execute the following instructions on the command line on the machine to ensure that you have the latest version of snapd.
  
  
Line 21: Line 21:
  
  
-===== Remove certbot-auto and any Certbot OS packages =====+===== 4. Remove certbot-auto and any Certbot OS packages =====
  
-4. If you have any Certbot packages installed using an OS package manager like apt, dnf, or yum, you should remove them before installing the Certbot snap to ensure that when you run the command certbot the snap is used rather than the installation from your OS package manager. The exact command to do this depends on your OS, but common examples are sudo apt-get remove certbot, sudo dnf remove certbot, or sudo yum remove certbot.+If you have any Certbot packages installed using an OS package manager like apt, dnf, or yum, you should remove them before installing the Certbot snap to ensure that when you run the command certbot the snap is used rather than the installation from your OS package manager. The exact command to do this depends on your OS, but common examples are sudo apt-get remove certbot, sudo dnf remove certbot, or sudo yum remove certbot.
  
 If you previously used Certbot through the certbot-auto script, you should also remove its installation by following the instructions here. If you previously used Certbot through the certbot-auto script, you should also remove its installation by following the instructions here.
 +
 +===== 5. Install Certbot =====
 +
 +Run this command on the command line on the machine to install Certbot.
 +
 +<code>sudo snap install --classic certbot</code>
 +
 +===== 6. Prepare the Certbot command =====
 +
 +Execute the following instruction on the command line on the machine to ensure that the certbot command can be run.
 +
 +<code>sudo ln -s /snap/bin/certbot /usr/bin/certbot</code>
 +
 +===== 7. Choose how you'd like to run Certbot =====
 +
 +Either get and install your certificates...
 +Run this command to get a certificate and have Certbot edit your Nginx configuration automatically to serve it, turning on HTTPS access in a single step.
 +
 +<code>sudo certbot --nginx</code>
 +==== Or, just get a certificate ====
 +
 +If you're feeling more conservative and would like to make the changes to your Nginx configuration by hand, run this command.
 +
 +<code>sudo certbot certonly --nginx</code>
 +
 +
 +
 +
 +===== 8. Test automatic renewal =====
 +
 +The Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. You will not need to run Certbot again, unless you change your configuration. You can test automatic renewal for your certificates by running this command:
 +
 +<code>sudo certbot renew --dry-run</code>
 +The command to renew certbot is installed in one of the following locations:
 +<code>
 +/etc/crontab/
 +/etc/cron.*/*
 +systemctl list-timers
 +</code>
 +
 +===== 9.Confirm that Certbot worked =====
 +
 +To confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar.
ssl.1611504886.txt.gz · Last modified: 2023/09/14 06:06 (external edit)