Background Image
Table of Contents Table of Contents
Previous Page  182 / 478 Next Page
Information
Show Menu
Previous Page 182 / 478 Next Page
Page Background

setuid elspeth

chdir /home/elspeth/sites/SITENAME/source

exec

../virtualenv/bin/gunicorn

\

--bind unix:/tmp/SITENAME.socket

\

superlists.

wsgi:application

Then it’s easy for us to use those two files to generate a new site, by doing a find & replace

on

SITENAME

.

For the rest, just keeping a few notes is OK. Why not keep them in a file in the repo too?

deploy_tools/provisioning_notes.md.

Provisioning a new site

=======================

## Required packages:

*

nginx

*

Python 3

*

Git

*

pip

*

virtualenv

eg, on Ubuntu:

sudo apt-get install nginx git python3 python3-pip

sudo pip3 install virtualenv

## Nginx Virtual Host config

*

see nginx.template.conf

*

replace SITENAME with, eg, staging.my-domain.com

## Upstart Job

*

see gunicorn-upstart.template.conf

*

replace SITENAME with, eg, staging.my-domain.com

## Folder structure:

Assume we have a user account at /home/username

/home/username

└── sites

└── SITENAME

├── database

├── source

├── static

└── virtualenv

We can do a commit for those:

154

|

Chapter 8: Testing Deployment Using a Staging Site