Skip to content
Anderson Pierre Cardoso edited this page Apr 28, 2014 · 5 revisions

This instalation guide assume you have a Ubuntu 13.10 or equivalent system. We recommend you to use a vagrant vm. (http://www.vagrantup.com/)

Vagrant:

  • after cloning the repo: vagrant up

and you will have a vagrant vm set, Unfornatelly the provision script was giving a lot of trouble, so the rest of the instalation is manual.

Manual instalation:

for both vagrant setup or local machine. Inside the mootiro-maps folder:

  • install dependencies
sudo apt-get install -y git nodejs npm rubygems python-dev python-pip ruby1.9.1-dev libev4 libev-dev libevent-2.0-5 libevent-dev postgresql-9.1 postgresql-9.1-postgis postgresql-server-dev-9.1 rabbitmq-server
  • setup virtualenv
sudo pip install fabric virtualenvwrapper
echo "
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
" >> ~/.bashrc
source ~/.bashrc

mkvirtualenv maps
workon maps
  • If you are on vagrant you might need to do this:
# Postgres evilness ... here be dragons!
locale-gen en_US.UTF-8
sudo sh -c "echo 'LANG=en_US.UTF-8' >> /etc/environment"
sudo sh -c "echo 'LC_ALL=en_US.UTF-8' >> /etc/environment"
sudo sh -c "echo 'LANGUAGE=\"en_US.UTF-8\"' >> /etc/default/locale"
sudo sh -c "echo 'LC_ALL=\"en_US.UTF-8\"' >> /etc/default/locale"

sudo pg_createcluster 9.1 main --start
sudo service postgresql start
sudo ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432  # evil trick for pg to work properly
  • setup pg user and db
sudo -u postgres createuser -r -s -d vagrant
sudo -u postgres createdb vagrant -O vagrant
  • If its your first setup (you dont have a local_settings.py and servers.conf yet):
cp mootiro_maps/settings/local_settings.py-dist mootiro_maps/settings/local_settings.py
sed -i -e "s/'USER': 'user'/'USER': 'vagrant'/g" mootiro_maps/settings/local_settings.py
sed -i -e "s/'PASSWORD': 'pass'/'PASSWORD': ''/g" mootiro_maps/settings/local_settings.py


cp fabfile/servers.conf-dist fabfile/servers.conf
sed -i -e "s/\/PATH\/TO\/YOUR\/DEVELOPMENT_CODE/\/home\/vagrant\/mootiro-maps/g" fabfile/servers.conf

  • load postgis template:
sh scripts/create_template_postgis.sh
  • Install node and ruby development dependecies:
sudo npm install -g coffee-script@1.2
sudo npm install -g requirejs@2.1

sudo gem install --version '~> 0.8.8' rb-inotify
sudo gem install listen
sudo gem install sass
  • configure rabbitmq:
sudo rabbitmqctl add_user komoo komoo
sudo rabbitmqctl add_vhost mootiro_maps_mq
sudo rabbitmqctl set_permissions -p mootiro_maps_mq komoo ".*" ".*" ".*"
  • Python dependencies
pip install -r mootiro_maps/settings/requirements.txt
  • Patch django (solves unicode + postgis issues)
fab local install.patch
  • install elasticsearch
  fab local install.elasticsearch
  • create db and tables:
fab local db.create db.sync
  • for indexing ES:
fab local run.shell
>>> from search.utils import reset_all
>>> reset_all()
  • for runing:
fab local run

automatic:

sh scripts/bootstrap.sh  # and cross your fingers
Clone this wiki locally