HOWTO: install Indivo X
From Indivo
Contents |
[edit] Defaults
This document sets up the Indivo backend server and Indivo UI server on the same machine. The backend server runs on port 8000, the UI server on port 80. This is configurable by changing the appropriate port numbers in the instructions below.
This document is up-to-date for Indivo X alpha 1 (0.8.1). See the Indivo X Alpha 1 (0.8.1) Release Notes.
[edit] Pre-Requisites
This documents the installation of a complete Indivo X server and user interface. For concreteness, we show all of the exact instructions needed when installing on Ubuntu Linux 9.10 (Karmic). We welcome variants of these explicit instructions from folks installing on other operating systems, we will be happy to post them alongside these instructions.
- Recent Linux installation (Kernel 2.6+)
- Note: We recommend you do this by sudo'ing from a non-root user. If you would like to do this as root make sure you create at least one non-root user with `useradd -m {USER}` otherwise the default locale will not be set. This issue is most common on a new OS build.
- PostgreSQL 8.3+
apt-get install postgresql
- Python 2.6 with packages: libxml2, libxslt1, psycopg2
apt-get install python-psycopg2 python-libxml2 python-libxslt1
- Django 1.1
apt-get install python-django
- Apache 2 (for production) with module mod_wsgi (mod_ssl for HTTPS is strongly recommended for production, but we won't cover its installation here.)
apt-get install apache2-mpm-prefork libapache2-mod-wsgi
[edit] Setup Database
You'll have the easiest time naming your database indivo
- There are two ways to authenticate to PostgreSQL: use your Unix credentials, or use a separate username and password. We strongly recommend the latter, and our instructions are tailored appropriately. If you know how to use PostgreSQL and want to use Unix-logins, go for it, just remember that when you use Apache, it will usually try to log in using its username, www-data.
- in /etc/postgresql/8.4/main/pg_hba.conf, find the line that reads:
local all all ident
This should be the second uncommented line in your default config. Change ident to md5:
local all all md5
You will need to restart PostgreSQL:
service postgresql-8.4 restart
- Create a PostgreSQL user for your Indivo service, e.g. "indivo" and setup a password
su - postgres createuser --superuser indivo psql postgres=# \password indivo
- Create the Database and make the Indivo user its owner.
createdb -O indivo indivo
[edit] Download, Install, and Configure Indivo Backend Server
- Download the latest release of Indivo X (see Releases) and untar into indivo_server/
- Copy settings.py.default to settings.py, and update a few key parameters:
- set DATABASE_USER to the username you chose, in this documentation web, and set DATABASE_PASSWORD accordingly.
- set APP_HOME to the complete path to the location where you've installed indivo_server, e.g. /web/indivo_server
- set SITE_URL_PREFIX to the URL where your server is running, including port number e.g. https://pchr.acme.com:8443
- set the EMAIL_* parameters appropriately for sending out emails.
- set the SEND_MAIL parameter to True or False depending on whether you want emails actually being sent.
- Copy bootstrap.py.default to bootstrap.py and edit accordingly.
- run the Django DB initialization:
python manage.py syncdb
[edit] Download, Install, and Configure UI Server
- Download the latest release of Indivo X UI Server (see Releases) and untar into indivo_ui_server/
- Copy settings.py.default to settings.py, and update a few key parameters:
- set INDIVO_UI_BASE to the complete path to the location where you've installed indivo_ui_server, e.g. /web/indivo_ui_server
- set INDIVO_SERVER_LOCATION, CONSUMER_KEY, CONSUMER_SECRET appropriately to match the Indivo Server's location and chrome credentials (check your bootstrap.py BEFORE you syncdb on the server end).
[edit] Running the Development Servers
The Django development servers are easy to run at the prompt.
The backend server can run on localhost in the configuration given above:
cd /web/indivo_server/ python manage.py runserver 8000
The UI server, if you want it accessible from another machine, needs to specify a hostname or IP address. If you want port 80, you need to be root of course:
cd /web/indivo_ui_server/ python manage.py runserver HOSTNAME:80
[edit] Running on Apache
Assuming you installed Indivo Server and UI in /web, the steps to getting Apache2 serving Indivo and its UI are:
- in /etc/apache2/sites-enabled/000-default, add:
<VirtualHost *:8000>
ServerAdmin YOU@localhost
ServerName localhost
DocumentRoot /web/indivo_server
Alias /static/ /web/indivo_server/static/
EnableMMAP On
EnableSendfile On
LogLevel warn
<Directory /web/indivo_server>
Order deny,allow
Allow from all
</Directory>
WSGIDaemonProcess indivo user=www-data group=www-data processes=1 maximum-requests=500 threads=10
WSGIProcessGroup indivo
WSGIScriptAlias / /web/indivo_server/django.wsgi
WSGIPassAuthorization On
</VirtualHost>
<VirtualHost *:80>
ServerAdmin YOU@localhost
ServerName localhost
DocumentRoot /web/indivo_ui_server
Alias /static/ /web/indivo_ui_server/ui/static/
EnableMMAP On
EnableSendfile On
LogLevel warn
<Directory /web/indivo_ui_server>
Order deny,allow
Allow from all
</Directory>
WSGIDaemonProcess indivo_ui user=www-data group=www-data processes=1 maximum-requests=500 threads=10
WSGIProcessGroup indivo_ui
WSGIScriptAlias / /web/indivo_ui_server/django.wsgi
WSGIPassAuthorization On
</VirtualHost>
- make sure ports.conf has:
NameVirtualHost *:80 Listen 80 Listen 8000
- make sure that www-data (or whoever is in /etc/apache2/envvars) has access to indivo_server and indivo_ui_server AND can write to indivo_server/indivo.logand indivo_ui_server/session/*, including the session/ directory itself.
- since you probably did a python manage.py syncdb, you almost certainly want to just remove the current indivo.log before you move ahead.
- really, have you checked this www-data permission issue? This will be the cause of all your problems if you don't check this carefully.
- restart Apache:
service apache2 restart
[edit] What Next?
You should be able to log in, but you won't see any apps. We'll be releasing apps over time, but you may want to start with our Sample PHA
[edit] BEFORE YOU RUN THIS IN PRODUCTION
It's alpha. Don't run this in production.
When Indivo is ready, you'll need to do the following things:
- change the SECRET_KEY parameter in both settings.py files.
