-
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)
- Surf up the root index.php and have fun!
- PHP >= 5.xx or higher
- PHP curl
- 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
- 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
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
/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":{}}' - 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
- 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