Install SQL Server 2019 CTP 2.2 on Ubuntu Part – 1

In this series of blog post, we are going to install SQL Server 2019 CTP 2.2 on Ubuntu 18.04.1 Bionic Beaver. This is the first Part of the series. And, In this first part, we are going to install and prepare Ubuntu 18.04.1 in Hyper-V Manager of Windows 10. You can also create virtual machine in Azure Cloud.

Hyper-V Manager

Whether you are a software developer, an IT professional, or a technology enthusiast, you need to run multiple operating systems including multiple flavor. Hyper-V lets you run multiple operating systems as virtual machines on Windows.

You can install Hyper-V Manager in many ways. First of all I am enabling using “Turn Windows Features on or off”.

  • Open control panel
  • Click on Programs & then “Turn Windows Features on or off”
  • Turn on Hyper-V and both of the features beneath it. Find screenshot to know what exactly need to tick.
  • Click Ok, and wait until it will install the Hyper-V feature.
  • Restart your computer.

Now, you have Hyper-V installed. We are quickly skipping to create a virtual machine on Hyper-V Manager using Quick Create Virtual Machine. Open Hyper-V and go to Action Quick Create. It will open the following window.

Create Virtual Machine using Hyper-V
Create Virtual Machine using Hyper-V Manager

Finally, click on Create Virtual Machine will download the Ubuntu and create a virtual machine for you.

Downloading image Ubuntu
Downloading image ‘Ubuntu 18.04.1 LTS’
Virtual Machine created
Virtual machine created Successfully

Install Ubuntu 18.04.1 LTS

Now, we have a virtual machine ready to start with the image of Ubuntu 18.04.1 LTS. You are just about to start the installation using turning on the virtual machine from Hyper-V. Turning on the virtual machine will launch the following installation wizard, then Choose your preferred language from the list.

Ubuntu Installation - Choose language
Welcome – Choose Language
Ubuntu Installation - Keyboard layout
Keyboard layout
Ubuntu Installation - Where are you?
Ubuntu Installation – Where are you?
ubuntu who are you
Ubuntu Installation – Who are you?

Now, you need to click on continue and take a rest until will install and ready the virtual machine with Ubuntu.

Preparing Ubuntu 18.04.1 for SQL Server 2019

After installation, you can take the virtual machine to install the SQL server, but at some point, it’s easy to login into the VM using tool like PuTTy using SSH. Ubuntu doesn’t install the SSH by default because of the security reason. So, you need to install the SSH. Here is the command to install and check the status of SSH server.

sudo apt install ssh
sudo service ssh status
Check status of SSH service
Check status of SSH service

So, I am going to conclude this blog post here, because this post was write with the intention to prepare Ubuntu to install SQL Server 2019 CTP 2.2, hence Please find more about How to install SQL Server 2019 CTP 2.2 in Hyper-V virtual machine in next Part the series.

Create SSL Certificate for your site using Let’s Encrypt

Let’s Encrypt is operated by a non-profit called Internet Security Research Group (ISRG). ISRG’s mission is to reduce financial, technological, and education barriers to secure communication over the Internet. It uses ACME to create the certificate for your environment which trusted all over the globe.

We learn how to Create a server and make website up and running in previous blog post, but creating server & website is not an enough in digital world. So, I am come up with blog post related to security of the website.

Nowadays, google is also considering site having SSL while ranking in search result.

It’s time for encrypted communications to be the default on the Web and Let’s Encrypt is going to make it happen. You can read more about becoming partner of Let’s Encrypt here.

I am assuming here that, you have latest server software installed on your environment. If you haven’t, you can install it using the following command.

For Ubuntu/Debian

sudo apt update
sudo apt upgrade

For CentOS

sudo yum update
sudo yum upgrade

Download or clone a let’s encrypt repository. Here I am assuming that you have git installed.

sudo git clone https://github.com/letsencrypt/letsencrypt /letsencrypt
cd /letsencrypt

If your server has anything which is running on 80 port then, you need to stop that server software ie. stop apache2 or httpd. Otherwise, let’s encrypt will give you an error message or unable to generate the certificate. 

Create Certificate using letsencrypt command.

Let’s Encrypt automatically performs Domain Validation using a series of challenges. The CA uses challenges to verify the authenticity of your server’s domain.

Here is the syntax for letsencrypt-auto command.

letsencrypt-auto [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...

You can also use multiple -d switch to specify the multiple domain, for which you want to generate the certificate. Here is command to generate the certificate. This command will generate the certificate for 6 months.

sudo -H ./letsencrypt-auto certonly --standalone -d www.yoursite.com -d yoursite.com

When you run the command it will ask you a series of question. Which include the administrative email address. Here administrative email address is very important in case you of any security notice or regain the certificate.

If all goes well then that process create a certificate for you.

Renew Certificate

You can renew same certificate by adding –renew-by-default switch in the command of create certificate. So, command to renew certificate is as following.

sudo -H ./letsencrypt-auto certonly --standalone --renew-by-default -d www.yoursite.com -d yoursite.com

You can also automate the certificate renewal using the Cron job, but for that, you need to have more knowledge about crontab.

Following is the command to renew the certificate non interactively.

./letsencrypt-auto renew

Add above command into the crontab file as following.

0 0 1 * * /opt/letsencrypt/letsencrypt-auto renew

Here you find the Integration guide for Let’s encrypt that you need to consider. Let’s encrypt has some rate limitation. So, please read both of the document before using it for your production. Thank You.