Created
February 28, 2011 23:53
-
-
Save gcollazo/848308 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To run do: curl https://theurl.com/bootstrap.sh | bash && source ~/.profile | |
# | |
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10 | |
# This script must install the following requirements | |
# * apache2 | |
# * mod_wsgi | |
# * mysql | |
# * pip | |
# * virtualenv | |
# * virtualenvwrapper | |
# * virtualenvwrapper setup | |
# * make webapps folder | |
# TODO: | |
# install git | |
# setup git | |
# set deployment ssh key | |
# pull master of project | |
# create virtualenv based on env.info file in project | |
# activate virtualenv | |
# install dependencies with pip | |
# migrate data using south | |
# create django.wsgi | |
# create vhost | |
# restart apache | |
# done! | |
# Define your settings | |
dbpass="password" | |
virtualenv_dir="/var/virtualenvs" | |
apps_dir="/var/webapps" | |
# Do the dirty work | |
echo "This will take a few minutes..." | |
sudo apt-get update -qq | |
sudo apt-get upgrade -qq | |
echo "mysql-server mysql-server/root_password select $dbpass" | sudo debconf-set-selections | |
echo "mysql-server mysql-server/root_password_again select $dbpass" | sudo debconf-set-selections | |
sudo apt-get install -qq mysql-server | |
sudo apt-get install -qq mysql-client | |
sudo apt-get install -qq apache2 libapache2-mod-wsgi | |
sudo apt-get install -qq python-setuptools python-dev build-essential python-pip | |
sudo pip install virtualenv | |
sudo pip install virtualenvwrapper | |
# Make virtualenvwrapper work | |
sudo mkdir $virtualenv_dir | |
sudo chown -R ubuntu:ubuntu $virtualenv_dir | |
echo "export WORKON_HOME=/var/virtualenvs" >> ~/.profile | |
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.profile | |
source ~/.profile | |
# Create WebApps Folder | |
sudo mkdir $apps_dir | |
sudo chown -R ubuntu:ubuntu $apps_dir | |
echo "All done now!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment