Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Latest commit

 

History

History
204 lines (135 loc) · 5.35 KB

INSTALLATION.rst

File metadata and controls

204 lines (135 loc) · 5.35 KB

Adhocracy installation

Adhocracy makes heavy use of buildout, a Python build tool. It downloads, configures and builds nearly all dependencies to create a repeatable and isolated environment. In addition it sets up the supervisord service manager, which allows to easily start and stop the services which Adhocracy needs to run:

  • adhocracy (http server that runs Adhocracy with Spawning/WSGI)
  • adhocracy_worker (background queue processing)
  • solr (searching)
  • memcached (key-value cache)
  • redis (internal messaging queue)

Adhocracy is known to work on all modern Linux distributions, but should also run on OS X and FreeBSD with minor modifications.

There are two supported ways of installing Adhocracy:

  • A fully automatic installation, which downloads and sets up everything, is available for Debian, Ubuntu and Arch Linux. This is basically a wrapper around buildout.
  • The manual installation, which directly uses the buildout commands.

Both are described in the following.

In any case you will need the following MIME types in /etc/mime.types:

# webfonts
application/x-font-woff woff
application/font-truetype ttf

# socialshareprivacy 1.5 language files
application/json lang

Automatic installation on debian, Ubuntu or Arch Linux with build.sh

On debian, Ubuntu, or Arch you can simply execute the following in a terminal:

wget -nv https://raw.github.com/liqd/adhocracy/develop/build.sh -O build.sh && sh build.sh

The script will use sudo to install the required dependencies, and install, set up, and start the required services.

Add -c hhu to install with the preconfiguration for HHU Düsseldorf.

Manual installation

Preparations

Install required system packages (Debian Jessie example):

$ sudo apt-get install gcc make build-essential bin86 unzip libpcre3-dev mercurial git libssl-dev libbz2-dev pkg-config
$ sudo apt-get install python python-setuptools
$ sudo apt-get install libsqlite3-dev postgresql-server-dev-all
$ sudo apt-get install openjdk-7-jre
$ sudo apt-get install ruby rubygems ruby-dev

To make the apache vhost config work run:

$ sudo apt-get install libapache2-mod-proxy-html
$ sudo a2enmod proxy proxy_http proxy_html

Check out Adhocracy:

$ git clone https://github.com/liqd/adhocracy
$ cd adhocracy

$ git submodule init
$ git submodule update

Setup an isolated python environment to run Adhocracy

To install Adhocracy you need python 2.7 with PIL (python imaging) but no other system-packages.

Compile python and PIL with the included python buildout:

$ cd python
$ python bootstrap.py
$ bin/buildout
$ cd ..

Configure Adhocracy as desired

Create a custom buildout file and customize it as desired:

$ cp buildout.cfg buildout-my.cfg
$ vi buildout-my.cfg

Install and start Adhocracy

Run buildout:

$ bin/python bootstrap.py
$ bin/buildout -c buildout-my.cfg

Start Adhocracy and dependent servers:

$ bin/supervisord

If you do not use the buildout to compile and start the database system (currently only possible for PostgreSQL, but disabled by default), you have to setup the Adhocracy database manually:

$ bin/paster setup-app etc/adhocracy.ini --name=content

Run Adhocracy

Start Adhocracy and all dependent servers:

$ bin/supervisord

Restart servers:

$ bin/supervisorctl reload

View the status of all servers:

$ bin/supervisorctl status

To start/stop one server:

$ bin/supervisorctl stop <name>

Start the Adhocracy server in foreground mode:

$ bin/supervisorctl stop adhocracy
$ bin/paster serve etc/adhocracy.ini

Buildout configuration

  • Read buildout_commmon.cfg and buildout_development.cfg to learn all buildout configuration options.
  • Customize buildout.cfg to change the domains, ports and server versions.
  • Instead of compiling all dependencies (postgres, solr,..) you can also use system packages.
  • Use your custom buildout file to remove the included files you do not need:
[buildout] extends = buildout\_development.cfg parts -= postgresql

Developer instructions

To use your own fork instead of the regular("upstream") adhocracy, use git remote:

$ git remote -v
origin  https://github.com/liqd/adhocracy (fetch)
origin  https://github.com/liqd/adhocracy (push)
$ git remote add USERNAME https://github.com/USERNAME/adhocracy
$ git push USERNAME

You can now execute git pull origin to update your local copy with new upstream changes. Use commit and push to record and publish your changes. As soon as you are confident that you have implemented a feature or corrected a bug, create a pull request to ask the core developers to incorporate your changes.