Blogs Hub

by Sumit Chourasia | Apr 27, 2020 | Category :coding | Tags : ssl फ्री-सर्वर nginx certbot

Installing a Free SSL certificate on the Ubuntu server using Certbot and nginx. - MiniTV

Installing a Free SSL certificate on the Ubuntu server using Certbot and nginx. - मिनी टीवी

A wildcard certificate is a certificate that covers one or more names starting with *. and that will be accepted by a web browser for any subdomain name with any label in place of the * character. for example, a certificate for *.example.com will be valid for www.example.com, mail.example.com, hello.example.com, or goodbye.example.com, but not for example.com.

 

1. SSH into the server

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

 

2. Add Certbot PPA

You'll need to add the Certbot PPA to your list of repositories. To do so, run the following commands on the command line on the machine:

sudo apt-get update

sudo apt-get install software-properties-common

sudo add-apt-repository universe

sudo add-apt-repository ppa:certbot/certbot

sudo apt-get update

 

3. Install Certbot

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

sudo apt-get install certbot python-certbot-nginx

 

4. 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

 

5. 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

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

/etc/crontab/

/etc/cron.*/*

systemctl list-timers

 

6. 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. If you want to check that you have the top-of-the-line installation, you can head to https://www.ssllabs.com/ssltest/.