Configuring Django and Nginx on Ubuntu 13.04

My motivation for this tutorial is that trying to follow other tutorials for the installation of Django and Nginx I kept running into hurdles. Even following the exact commands I could not reproduce the results in other tutorials. This tutorial uses a clean Ubuntu 13.04 image from Amazon EC2 and the steps should be exactly reproducible.

1. Setting up the server

If you're familiar with provisioning a new server on Amazon EC2 then Skip to Section 2.

1.1 Key Creation

Firstly we require a public key to be able to provision a server. This is to provid security by means of key-exchange which is more secure than using passwords as they cannot be guessed. To create a new key you can use the amazon ec2 console and download the key or you can run the command:

ssh-keygen -t rsa -f newkey richard@Locke:~$ ssh-keygen -t rsa -f newkey
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):

At the prompt enter a secure password. This password secures the key locally. When using the key to connect to the server this password is never transmitted. You can have a key without a passphrase if you prefer.

This will create a key pair, a private key stored in newkey and a public key in newkey.pub. To upload the the public key to Amazon browse to the EC2 console and select Key Pairs from the right-hand menu and then Import from the button at the top.

Important: Upload your Public Key not your private key.

1.2 Launch Instance

To create the server select Launch Instance.

From the prompt select QuickLaunch Wizard, then from the list of images select Ubuntu Server 13.04.

Select your key pair and then scroll down and choose Ubuntu Server 13.04. This tutorial is likely to fail when trying to follow it from Ubuntu 12.04.2 LTS because of library dependencies.[1]