Skip to content

Server requirements

jasonpriem edited this page Nov 15, 2011 · 29 revisions

Instructions for installing total-impact locally

total-impact has three components, any of which can be run locally:

  1. the webpage display and logic
  2. metrics and alias plugins
  3. couchDB

Running couchDB locally is out of the scope of these instructions.

Running webpage display and logic locally

  1. Update environment to have server requirements below
  2. In your webserver root directory, clone a version of the project
    $ git clone git://github.com/mhahnel/Total-Impact.git
  3. Make sure everything has executable permissions (plugins directory not relevant for this step, plugins will continue to run on the main total-impact server unless you follow the instructions below for running plugins locally)
  4. Ask us for data sources API password/key files
  5. Surf up the root index.php and have fun!

Server requirements for running webpage display and logic

  1. PHP >= 5.xx or higher
  2. PHP curl
  3. PHP PECL/HTTP (how to install)

More detail:

####PHP PECL/HTTP

It does not come with the standard PHP installation. (fyi The app uses it to issue parallel HTTP requests to the plugins via http://php.net/manual/en/class.httprequestpool.php.)

  • Installation instructions here: http://www.php.net/manual/en/http.install.php
  • To get it running on Ubuntu:
    sudo apt-get install php5-dev
    sudo apt-get install libcurl4-gnutls-dev
    sudo apt-get pear sudo pecl install pecl_http
    sudo cp /usr/lib/php5/20090626+lfs/http.so /usr/lib/apache2/modules/
    create a file at /etc/php5/conf.d/http.ini and add this line:
    extension=http.so
    sudo /etc/init.d/apache2 restart

Running plugins locally

These instructions are for running the alias and metrics plugin code included this git project. You can write your own plugins in whatever language you'd like, with no requirements other than that they conform to our REST API.

To run the plugin code included in this git project:

  1. Update environment to have server requirements below
  2. In your webserver root directory, clone a version of the project
    $ git clone git://github.com/mhahnel/Total-Impact.git
  3. Make sure everything in the plugins directory has executable permissions. This includes .pyc files which are only generated after the code is run once. This can be tricky and a source of errors!
  4. If you want your local plugins to be called by the server webpage code, edit the urls in the config file https://github.com/mhahnel/Total-Impact/blob/master/config/app.ini
  5. Ask us for data sources API password/key files

You can run/test the plugins in several ways. When plugins are called with no arguments they are designed to return sample output.

  1. Through a browser: http://total-impact.org/plugins/metrics/PlosAlm/index.cgi or with arguments like this: http://total-impact.org/plugins/metrics/PlosAlm/index.cgi?query={"10.1371/journal.pbio.0050082":{}}]

  2. On the command line

    /total-impact/plugins/metrics/PlosAlm$ python index.cgi

or with an argument like this:

` /total-impact/plugins/metrics/PlosAlm$ python index.cgi '{"10.1371/journal.pbio.0050082":{}}'`
  1. On the command line through a script to run all at once, with default input:

    /total-impact/plugins/metrics$ sh MANUALLY_RUN_PLUGINS.sh

Server requirements for running existing plugins

  1. Apache support for Python CGI
  2. Required Python Libraries

Details:

####Apache support for Python CGI:

For unix, open /etc/apache2/sites-available/default (or in our case, sudo emacs /etc/apache2/sites-available/total-impact.org) and add this, with directory name modified appropriately:

    `<Directory /home/ti/Total-Impact/plugins>
    `        AllowOverride All
    `        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    `        Order allow,deny
    `        Allow from all
    `        AddHandler cgi-script py cgi
    `</Directory>

####Required Python Libraries:

simplejson, BeautifulSoup, nose, httplib2, re, time, urllib2, os
$ sudo easy_install simplejson, BeautifulSoup, nose, httplib2, re, time, urllib2, os

Clone this wiki locally