-
Notifications
You must be signed in to change notification settings - Fork 4
Server requirements
total-impact has three components, any of which can be run locally:
- the webpage display and logic
- metrics and alias plugins
- couchDB
Running couchDB locally is out of the scope of these instructions.
- Update environment to have server requirements below
- In your webserver root directory, clone a version of the project
$ git clone git://github.com/mhahnel/Total-Impact.git
- 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)
- Ask us for data sources API password/key files
- Surf up the root index.php and have fun!
- PHP >= 5.xx or higher
- PHP curl
- 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
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:
- Update environment to have server requirements below
- In your webserver root directory, clone a version of the project
$ git clone git://github.com/mhahnel/Total-Impact.git
- 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!
- 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
- 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.
-
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":{}}]
-
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":{}}'`
-
On the command line through a script to run all at once, with default input:
/total-impact/plugins/metrics$ sh MANUALLY_RUN_PLUGINS.sh
- Apache support for Python CGI
- 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