This project contains two Python scripts to be used as command-line tools:
- installold.py installs the OLD (on Ubuntu 10.04, at least)
- buildold.py builds OLDs once the OLD software is installed.
A command line utility for installing the OLD, on Ubuntu 10.04. Additional platforms may be supported in future versions.
To install the OLD:
A command line utility for building (and serving) OLD applications. The server that this is run on must already have the OLD software (https://github.com/jrwdunham/old) and all of its dependencies installed. This is what buildold does:
- Creates needed directories.
- Creates the MySQL database.
- Runs paster commands to:
- create the OLD config file,
- perform setup (build the tables and add default data), and
- serve the app.
- Modifies /etc/apache2/sites-available/<VIRT_HOSTS_FILE> appropriately.
- Restarts Apache.
- Adds a Cronjob to restart the OLD every minute, if it's down.
To build and serve an OLD called "bla" (e.g., for Blackfoot):
$ ./buildold.py bla
Additional information is required to build an OLD. You can specify it in options or let the script prompt you for it. The easiest, though, is to use the --config-file option to specify a path to a JSON config file that holds this information in an object with any of the following keys: 'mysql_user', 'paster_path', 'apps_path', 'vh_path', or 'host':
$ ./buildold.py bla --config-file=buildold.conf
To see available options:
$ ./buildold.py -h
To destroy an OLD that was built using this script:
$ ./buildold.py bla --destroy
Python-crontab (https://pypi.python.org/pypi/python-crontab) should be installed if you want the OLD-restart cronjob to be created for you. But the script will still work without it.
- This script assumes that you are serving OLDs on a Debian/Ubuntu Linux server; it currently (probably) won't work on Mac or RHEL/CentOS. It basically follows the instructions of Chapter 21 Deployment of The Definitive Guide to Pylons.
- You'll run into problems if you change the vh_path option after you have installed OLDs with a different Apache virtual hosts config file. Don't do this.
- stop serving an OLD and redirect requests to a notification page.
- start serving an already-built OLD that has been stopped.