Skip to content

Server requirements

hpiwowar edited this page Sep 18, 2011 · 29 revisions

Instructions and requirements 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. Surf up the root index.php and have fun!

Server requirements

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

More detail:

####PHP 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 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

  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

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 /Library/WebServer/Documents/total-impact/plugins/metrics/PlosAlm$ python index.cgi or with an argument like this: /Library/WebServer/Documents/total-impact/plugins/metrics/PlosAlm$ python index.cgi '{"10.1371/journal.pbio.0050082":{}}'
  3. On the command line through a script to run all at once, with default input: `/Library/WebServer/Documents/total-impact/plugins/metrics/PlosAlm$ sh MANUALLY_RUN_PLUGINS.sh

Server requirements

  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