Follow instructions in docs/new-box-checklist.txt.
$ cd python-code $ pip install -r requirements.txt
$ sudo apt-get install apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapache2-mod-proxy-html
$ sudo cp apache2/{{ something }}.conf /etc/apache2/sites-available/
$ sudo vi /etc/apache2/sites-available/{{ something }}.conf # read comments for sections to edit
$ sudo a2ensite {{ something }}.conf
$ sudo a2enmod proxy
$ sudo a2enmod rewrite
$ sudo a2enmod proxy_http
$ sudo service apache2 restart
Become the postgres user:
$ sudo su postgres $ createuser --pwprompt budgetbot $ createdb --owner budgetbot budgetbot_dev # _dev could be _prod or something else! $ createlang plpythonu budgetbot_dev $ psql -d budgetbot_dev -c 'create extension "hstore";' $ psql -d budgetbot_dev -c 'create extension "uuid-ossp";' $ psql -d budgetbot_dev -c 'create extension "pgcrypto";' $ psql -d budgetbot_dev -c 'create extension "citext";' $ exit
- Copy dev.yaml.example to something like dev.yaml.
- Edit dev.yaml and put in the postgresql user, database, and password.
Then:
$ cd database-change-scripts $ python upgrade_database.py dev.yaml
$ cd database-change-scripts
Then edit setup.py to install the run-dev-webapp script.
Then reinstall everything with:
$ pip install -r requirements.txt
And now, run-dev-webapp should be installed in your path
$ cd static $ bower install
That will pull down all the javascript libraries we need.
Try this out:
$ run-dev-webapp
- Copy test.yaml.example to test.yaml and set up test database.
- Create a unix user budgetbot
- Set up supervisord to start on boot using upstart
- Fire up everything through supervisor
- load the budgetbot schema into the database
- Set up supervisord to run gunicorn
- Set up upstart to make sure supervisord starts on boot
edit .conf files in the /etc/init
copy the supervisor conf in the upstart directory
edit to point to correct virtual environment