Skip to content

Setup on EC2 Ubuntu

Matt LeBel edited this page Aug 14, 2013 · 1 revision

These instructions (written by Charles Cary) cover setting up crowdhoster on EC2 (ami-d0f89fb9) running ubuntu 12.04

# update and install git
sudo apt-get update
sudo apt-get install git

# install rvm
# may need to sudo this
\curl -L https://get.rvm.io | bash -s stable --rails --ruby=1.9.3
source /home/ubuntu/.rvm/scripts/rvm
rvm use 1.9.3 --default

# install imagemagick
sudo apt-get install imagemagick

# install postgres
sudo apt-get install postgresql

# configure postgres - NOT NECESSARILY SAFE FOR PRODUCTION (lets just get this working)
cd /etc/postgresql/9.1/main
sudo vim pg_hba.conf

#change the md5 to trust for these three entries
# "local" is for Unix domain socket connections only
# local   all             all                                     trust
# IPv4 local connections:
# host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
# host    all             all             ::1/128                 trust

# restart postgres
sudo /etc/init.d/postgresql restart

#now you need to create a role for the user you will run as (this will use your username)
sudo -u postgres createuser --superuser $USER

# repo
git clone https://github.com/Crowdtilt/Crowdhoster.git
cd Crowdhoster
cp .env.example .env
# now add your credentials to .env

# prereqs for bundle install
sudo apt-get install libxml2-dev
sudo apt-get install libxslt-dev
sudo apt-get install libpq-dev

bundle install

sudo apt-get install nodejs
# or another runtime for js...
# e.g.gem install therubyracer

foreman run rake db:create
foreman run rake db:migrate

foreman start