Categories
Cyber Security Digital Ocean Latest Tech Tips

Install SSL certificate for free in Digital Ocean using let’s encrypt ubuntu

Hi Guys, SSL is the most prominent factor in SEO and digital marketing, even most browsers show it non-secure when you don’t hae SSL installed on your site and your visitors get away. So in this article, I will cover how to install a free SSL certificate if you are using any cloud server with Ubuntu OS. I’m taking an example of Digital Ocean.

I have just set up a sub-domain http://nexgi.laestrella.store (and this blog is in the same continuation of that – to better understand please go through How to setup Sub-domain in digital Ocean & Activate SSL)

In this we will learn or do:

  1. Check Certbot is install or not?
    1. What is Certbot?
    2. How to check if Certbot is already installed?
  2. Install SSL on domain or sub-domain?
    1. Install on non-www
    2. Install on www
    3. Both non-www and www
    4. Restart your server
    5. Test SSL certificate

Step1. Check Certbot is install or not?

What is Certbot?

Certbot is a client that helps in installing SSL certificates, also provides automatic redirection facilities to http –> https. In simple language, you can say Certbot is a software that helps to install SSL certificates.

How to check if Certbot is already installed?

Open your terminal through SSH or putty and type following command –

certbot

You are getting this No command ‘certbot’ found – means you need to install it.
Install it by pressing the following command

sudo add-apt-repository ppa:certbot/certbot

Then

sudo apt-get update

Then Final

sudo apt-get install python-certbot-apache

Step 2. Install SSL on domain or sub-domain

There are three possibilities of this command to install SSL on your domain or sub-domain (Replace your domain/sub-domain from the bold text)

  1. If you want to install on non-www
    use the command:

    sudo certbot --apache -d nexgi.laestrella.store
  2. If you want to install on www
    use the command:

    sudo certbot --apache -d www.nexgi.laestrella.store
  3. In case you want to install on both non-www and www
    use the command:

    sudo certbot --apache -d nexgi.laestrella.store -d www.nexgi.laestrella.store
    install letsencrypt digital ocean ubuntu

Then it will ask for redirection – select 1. (No. Redirection – check read marker in below image).
install letsencrypt ubuntu 16.04 nginx
and it will install your SSL certificates.

Just restart your server by pressing following command –

sudo service apache2 restart

You can test your configuration at (replace bold with your domain/sub-domain)

https://www.ssllabs.com/ssltest/analyze.html?d=nexgi.laestrella.store https://www.ssllabs.com/ssltest/analyze.html?d=www.nexgi.laestrella.store

That’s it – you are ready for testing.
Just hit your domain with https like in my case

https://nexgi.laestrella.store/

free ssl installation in ubuntuhttps://www.nexgi.laestrella.store/

install letsencrypt ubuntu 16.04 nginx

Thanks for any query or support you can contact us.

Categories
Digital Ocean Latest

How to setup Sub-domain in digital Ocean and Activate SSL

While using a cloud server. It always very difficult to setup domain or sub-domain in the digital ocean or AWS & activate SSL. In given few steps I will explain to you how easily you can setup a sub-domain and activate free SSL.

Setup Sub – Domain in Digital Ocean

  1. Login Digital Ocean
  2. Click on the domain – e.g I want to make nexgi.laestrella.store – so I m click on laestrella.store
    As marked in red.
    How to setup Sub-domain in digital Ocean and Activate SSL
  3. Then Add two records as given screenshot
    First nexgi second www.nexgi (only write bold text) and point to your droplet. (see below)

    How to setup Sub-domain in digital Ocean and Activate SSL
    For NON-WWW
    digital ocean ssl free
    For with WWW

     

  4. Now your subdomain is pointing to your droplet but – if you will hit/open it. It will open default or main domain. So Now you have to tell which folder will be pointed when someone hit this sub-domain using a virtual host.
  5. Access your terminal/or GUI method & create a folder where you want to point this subdomain like I created nexgi.laestrella.store under /var/www/
    like I created /var/www/nexgi.laestrella.store
  6. Make a Sample file in this domain with name of index.html with below code – It will help to confirm your sub-domain is pointing right directory.
    <h1>It’s pointing to http://nexgi.laestrella.store</h1>
    
    
  7. Now you have to make a config file in apache at below location
    /etc/apache2/sites-available/nexgi.laestrella.store.conf Please note: this location may differ as per your installation path. Paste following codes & change the bold text as per your domain & pointing directory name.

    <VirtualHost *:80>
    ServerAdmin [email protected]nexgi.laestrella.store
    ServerName nexgi.laestrella.store
    ServerAlias www.nexgi.laestrella.store
    DocumentRoot /var/www/nexgi.laestrella.store
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
  8. Now, this site is available but not enabled or activated to work.
    To enable it – you need to press a small command from terminal & change the bold sub-domain as per yours.

    sudo a2ensite nexgi.laestrella.store

    Then reload your server configuration – by hitting

    service apache2 reload
  9. Now you have enabled successfully – Just you need to reload your server configuration. Navigate your sub – domain – like in my case –
    With WWW http://www.nexgi.laestrella.store/
    how to install ssl certificate godaddy
    Don’t forget to test without WWW
    like in my case http://nexgi.laestrella.store/
    How to setup Sub-domain in digital Ocean and Activate SSL

 

Install SSL certificate for free in digital ocean using letsencrypt ubuntu