Install SSL on Nginx of Ubuntu 20

 

  • SSH into the server

    SSH into the server running your HTTP website as a user with sudo privileges.

  • Install snapd

    You'll need to install snapd and make sure you follow any instructions to enable classic snap support.

  • Ensure that your version of snapd is up to date

    Execute the following instructions on the command line on the machine to ensure that you have the latest version of snapd.

    sudo snap install core; sudo snap refresh core
  • Remove certbot-auto and any Certbot OS packages

    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.

  • Install Certbot

    Run this command on the command line on the machine to install Certbot.

    sudo snap install --classic certbot
  • Prepare the Certbot command

    Execute the following instruction on the command line on the machine to ensure that the certbot command can be run.

    sudo ln -s /snap/bin/certbot /usr/bin/certbot
  • 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.

    sudo certbot --nginx

    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.

    sudo certbot certonly --nginx
  • 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:

    sudo certbot renew --dry-run

    or sudo certbot certonly --webroot -w /var/www/html -d domain.com -d www.domain.com --dry-run
    Then sudo certbot renew --force-renewal

    The command to renew certbot is installed in one of the following locations:

    • /etc/crontab/
    • /etc/cron.*/*
    • systemctl list-timers
  • 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.

 

  • 0 utilizatori au considerat informația utilă
Răspunsul a fost util?

Articole similare

What is DNS?

DNS Certification Authority Authorization (CAA) is an Internet security policy mechanism which...

What is SSL?

Secure Sockets Layer (SSL) certificates create an encrypted connection and establish trust. One...

DNS Propagation

For all new domain it need some time to DNS propagated. Have you recently switched web host or...

How check SSL certificate on your website

You can review the SSL of your website by the below link.   https://www.sslshopper.com Please...

Why from browser padlock not showing or show broken or not show in green color?

If your site having mixed content then padlock some time show in black or show in broken or do...

Powered by WHMCompleteSolution