Skip to content
bethard edited this page Aug 21, 2015 · 16 revisions

Install Anafora Prerequisites

  1. Apache Httpd
  2. Django
  3. mod_wsgi

Install Anafora

Download Anafora somewhere to your server (e.g., /var/www/anafora/) by either:

Configure Apache web server

You will need to make changes to your Apache configuration file (e.g., /etc/apache2/apache2.conf) to point Apache the Django framework and to select the type of authentication for Anafora to use.

Configure Django and mod_wsgi

Add the following to your Apache configuration file (e.g., /etc/apache2/apache2.conf)

Alias /anafora/static /path_to_anafora/src/main/static
WSGIScriptAlias /anafora /path_to_anafora/src/main/web/wsgi.py
WSGIPythonPath /path_to_anafora/src/main

This will:

  1. Make available all the static files (JavaScript, CSS, images, etc.) which are not handled by Django
  2. Identify the Django script that should be used by mod_wsgi
  3. Place the Anafora code on the PYTHONPATH so that it can be found by mod_wsgi

Configure authentication

If you are using digest authentication, enable mod_auth_digest if it is not already enabled, then create an anafora.htdigest file, and add something like the following to your Apache configuration file:

<Location /anafora>
AuthType Digest
AuthName "anafora"
AuthDigestProvider file
AuthUserFile /path_to_anafora/anafora.htdigest
Require valid-user
</Location>

If you are using LDAP authentication, enable mod_authnz_ldap if it is not already enabled, then comment out the line with 'annotate.anaforaAuthMiddleware.AnaforaAuthMiddleware' in /path_to_anafora/src/main/web/settings.py, and add something like the following to your Apache configuration file:

<Location /anafora>
AuthType Basic
AuthName "anafora"
AuthBasicProvider ldap
AuthLDAPURL "ldap://ldap.example.com:389/o=example.com"
Require valid-user
</Location>

Configure Anafora

You will need to modify Anafora's settings.py file and configure permissions for the projects directory where annotated corpora will be stored.

Configure Anafora settings

Edit the following variables in /path_to_anafora/src/main/web/settings.py:

  • ROOT_URL: Setting the path to access your Anafora site. ex: '/anafora'
  • SECRET_KEY: Enter a secret string, and never share with anyone else
  • TEMPLATE_DIRS: The path to the template directory, ex: /path_to_anafora/src/Templates
  • ANAFORA_PROJECT_FILE_ROOT: Path to the project file root directory. ex: /path_to_anafora/sample data/sampleanaforaprojectfile`
  • GROUP_FILE: Assign this value if you use the HTDIGEST auth. Otherwise, comment this line. The group file format is followed by the Apache auth_group_file format.
  • ADMIN_GROUPNAME: Assign the name of the administrator group.
  • ANAFORA_PROJECT_SETTING_FILENAME: Assign the file name that had the data repository setting file which must be located on the root of the repository directory.

Configure Anafora permissions

More details are provided in the Anafora Manual, but in short:

chgrp -R anaforaadmin *
setfacl -R  -m u:nobody:rwx *
chmod -R 770 *
find -type d -exec chmod g+s {} \;

You may need to use www-data instead of nobody depending on your Apache configuration.

Open anafora in a browser

Test your installation by visiting http://your_domain/anafora