Since it is unlikely that this would ever be installed outside a Fedora environment, these installation instructions are for Fedora.
Boji uses fabric to do the remote deployments, so you’ll need that locally if you want to deploy to a remote server (not needed for a local install).
yum install fabric
Distribute takes care of most of the python dependencies on the remote host and boji will be installed into a virtualenv, so you don’t have to worry about messing up your default python installation.
However, there are some dependencies that need to be installed with yum.
On some hosts (specifically, Fedora 16) you need to append the following line to /etc/httpd/conf.d/wsgi.conf
WSGISocketPrefix /var/run/wsgi
There are two ways to install boji depending on whether you want to use fabric or do it manually (in case you don’t want to use fabric or can’t use it).
Fabric will prompt you for the remote password once while installing.
If you are deploying to a local machine or something that fabric can’t work with (ie needing to forward ssh keys etc.) you can install directly.
Everything should be set and boji will now be running at http://hostname.domain/boji and everlasting happiness shall ensue ...
With either method of updating, you need to get the latest code from git. From the local machine, update the git checkout:
git pull
Assuming that your virtualenv is installed at /var/www/boji/env, cd into the directory containing the updated boji code and run
/var/www/boji/env/bin/python setup.py install
The wsgi app is configured to reload on file changes, so httpd shouldn’t need to be restarted after updating boji. If the changes don’t show up, touch the wsgi file
touch /var/www/boji/boji.wsgi
Boji can also be run with a development server. The easiest way to do this is to set up a virtualenv containing all of the dependencies.
- yum install python-virtualenv
- sh runtests.sh
Running the tests this way will set up a virtualenv for you and install all of the required dependencies.
By default, the development server will run on localhost. This means that nothing outside the local machine will be able to access the application. To change this, edit the main method of boji.py.
Changing the host='localhost' to be host=<my_ipaddr> where <my_ipaddr> is the external ip or hostname of your machine will allow the application to be accessed from other machines.
Before starting the development server, activate the virtualenv:
source env_flask/bin/activate
To start the development server:
python mock_fedorainfra/boji.py
By default, the development server will run on port 5000 and reloads the application whenever you change any files associated with the application.