Installing SSL certificates for Nginx on Ubuntu

Purchasing an SSL certificate requires creating a Certificate Signing Request (CSR) which you can do on your host using:

openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr

When you purchase your certificate from your vendor, you’ll provide the text content from your CSR file. Once you have the certificate files (normally a .crt and a .key file), transfer them to your server, and place them somewhere like /etc/ssl-certs/.

In your /etc/nginx/nginx.conf (or /etc/nginx/sites-enabled/default), add to the server {  } block:

server {
  listen 443 ssl;
  ssl on;
  ssl_certificate     /etc/ssl-certs/yourdomain_com.crt;
  ssl_certificate_key /etc/ssl-certs/yourdomain.com.key;
  ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers         HIGH:!aNULL:!MD5;
        
  # rest of server config
}

Restart nginx with:

sudo service nginx restart

This is documented in the nginx docs here.

Enabling Ubuntu Bash shell on Windows 10 with the Anniversary update

I already have the Anniversary Update on my Windows 10 install, and I needed to ssh into one of my Raspberry Pis. I normally do this from my Mac, but since I’m in Windows 10 working on something, I thought this would be a great opportunity to install the new Ubuntu Bash support and then I can ssh from there right? (I could just install Putty, but then I wouldn’t have a reason to check out the Ubuntu Bash support, right?)

First attempt following instructions here, the bash windows opened and closed quick, too quick to read whether there was an error or not.

Second attempt, from a Command Prompt, entering bash, I got this:

Ok, to enable Developer Mode, into Settings, and click the radio button under ‘Use Developer Features’:

Then I got this error:

Hmm. Not very helpful. Clicking on Learn More opened a browser to a help page, but it didn’t load – I’d reconfigured my ip address to a static address on a local network for testing, and I didn’t have internet access. 0x80004005 probably could be a little more helpful, but enabling DHCP to get an internet connection and then tried selecting the Developer Mode option again, it downloaded, said ‘Some features may not be available until your PC is rebooted’. Rebooted, ran bash from Command Prompt, and now it prompted to download the Ubuntu Bash support. Why it couldn’t have done this already is beyond me, and I’ve already rebooted once, but answering ‘y’ it starts downloading:

After it completes you create a unix user and then you’re all set, and it even has ssh included.

Building autogen based source on Ubuntu and derivatives

 

Install build tools:

sudo apt-get install build-essential

Install autogen tools:

sudo apt-get install autogen

In project source:

./autogen.sh

If you get errors like this:

configure.ac:25: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

… then also install libtool

sudo apt-get install libtool

Then build and install as normal:

./configure
make
sudo make install

 

 

Using Grub Customizer to … do what it says

Customizing your Grub2 config by hand is not a trivial task. On a re-purposed desktop over the past couple of months I’ve installed a bunch of different OSes, and my Grub menu on boot is a mess to say the least.

After installing more than one bootable Linux, you also (unless there’s a workaround for this?) end up with each Linux having it’s own grub config (/boot/grub/grub.cfg), although only one (the last installed) will have installed it’s config to your MBR. There’s a good question/answer on this here. In my case I do have two Linux installs, Mint and Kubuntu, so I did have to look at the config of each and work out which was currently installed to the MBR before I started doing any editing of the configs.

Luckily there’s an easier way to customize what OSes you have in your menu, using Grub Customizer – for install and usage see post here.

Part of my mess is having a prior install of Vista, upgraded to Windows 8, and then later upgraded to Windows 10. The boot menu options left behind are now for some reason a mix of all 3, even though only Windows 10 is actually installed and bootable. Plus I have a few Linux distros too:

Switching to View/Show Hidden, you can uncheck the menu entries you don’t want displayed, so that’s an easy fix. There’s plenty more options to configure and customize too, but for simple menu housecleaning, it’s an easier option than attempting to edit the grub config files by hand.