reg88 // Mike Moghadas

Install and Configure Nginx+Django+uWSGI on Ubuntu 10.04 LTS

Getting Nginx+Django+uWSGI to work together via repositories is fairly easy.  The same goes for getting this setup working from source.. You just have to have good instructions. Here’s a very simple and quick install guide.

Install packages required to build and install from source. Also, Nginx is installed to take care of some of the prerequisites and to install configuration files.

Remove and purge Nginx installation. Configuration and startup files are left behind.

Install Django

If using memcached, Install the memcached client

Create the install structure and download/extract the required files

Build and Install uWSGI

Some preperations to before building Nginx

Build and Install Nginx

Create structure and build your DEMO Django project

Configure init daemon to control your uWSGI application

Start your uWSGI

Configure Nginx to start your Site

# You may also add the below section to secure Nginx a bit
# NOTE: Nginx default keepalive_timeout might currently be set. Comment out the default and use the below setting.

Create some configuration directories. This is where you drop Site files
# Make sure the following directories exist. If not, create them

Remove the default Site if you like. If you plan to leave this site alone, you must configure your uWSGI applicaiton to run on a alternative port

Create your Site (VirtualHost)

Enable your new Site

Modify Nginx init with the new installation PATH

Update Site permissions

Start/restart your Nginx Service

Leave a Reply

Your email address will not be published. Required fields are marked *