Skip to content

Instantly share code, notes, and snippets.

@ruiwen
Created February 8, 2012 13:13
Show Gist options
  • Save ruiwen/1769347 to your computer and use it in GitHub Desktop.
Save ruiwen/1769347 to your computer and use it in GitHub Desktop.
Server setup for Django / uWSGI / nginx
#!/bin/bash
# Check if we're root
if [ 0 -ne `id -u` ]; then
id -u
echo "This script needs to be run as root. Exiting."
exit 1
fi
# Add uwsgi and nginx repositories
#add-apt-repository ppa:uwsgi/release
#add-apt-repository ppa:nginx/stable
# Initial update
#apt-get update
# Needed libraries
apt-get install build-essential
apt-get install python-dev
apt-get install libmysqlclient-dev
apt-get install libjpeg8-dev
apt-get install zlib1g-dev
# Web server stuff
apt-get install uwsgi
apt-get install uwsgi-plugin-python
#apt-get install nginx-common nginx-full
apt-get install nginx
# Supporting applications / libraries
apt-get install python-mysqldb
apt-get install git
apt-get install mercurial
apt-get install python-pip
apt-get install virtualenv
# Other admin
adduser --system --group --no-create-home --disabled-password --disabled-login uwsgi
# Stuff with prompts
apt-get install mysql-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment