Skip to content

Instantly share code, notes, and snippets.

Created June 22, 2012 19:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2974698 to your computer and use it in GitHub Desktop.
Save anonymous/2974698 to your computer and use it in GitHub Desktop.
Part 1
#! /bin/sh
# get nginx
sudo apt-get update
sudo apt-get install nginx sqlite
# set up nginx
cd ~
sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/defaultoriginal
wget https://gist.github.com/gists/2968299/download
tar xzvf download
sudo cp ./gist2968299-5b27b6cf9fcd7e13e9424d4bae7f1c633624c0a9/default /etc/nginx/sites-available/default
rm -rf download
rm -rf gist2968299-5b27b6cf9fcd7e13e9424d4bae7f1c633624c0a9
# create user permissions for /var/www
sudo groupadd www-pub
sudo mkdir /var/www
sudo mkdir /var/www/django
sudo mkdir /var/www/static
sudo usermod -a -Gwww-pub pi
sudo chown -R root:www-pub /var/www
sudo chmod 2775 /var/www
sudo find /var/www -type d -exec chmod 2775 {} +
sudo find /var/www -type f -exec chmod 0664 {} +
sudo echo -e " " >> /etc/profile
sudo echo -e "umask 0002" >> /etc/profile
# get Django
cd ~
wget https://www.djangoproject.com/download/1.4/tarball/
tar xzvf tarball
cd Django-1.4
sudo python setup.py install
echo -e " "
echo -e " "
echo -e "import django; print('Django Version ' + django.get_version())" | python
echo -e " "
echo -e " "
echo -e "If you didn't see a python error, type 'logout' and hit enter"
echo -e " "
echo -e " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment