|Edited by:||H.I. Reuter|
Cookbook for pyWPS installation
To install pyWPS, start by the latest version of the software from the server:
Next, install Webserver, GDAL, Scipy, etc. Start by installing Apache and Python:
apt-get install python gdal-bin python-gdal python-scipy apache2
apt-get install python-htmltmpl python-xml python-magic
Some of the above listed packages, depending on the library, might not install in one go, hence it is good idea to check that all installation was successful.
We can now create a directory to put the pyWPS installation:
and change to that directory
Next, download the pyWPS installer.
If you are missing wget, you can try to get it via apt-get:
apt-get install wget
Before installing pyWPS, you need to change permission (to get help files under unix use the man command, e.g. man chmod):
chmod 700 install_pywps_svn.sh
You can also get the latest svn version of pyWPS:
svn checkout https://svn.wald.intevation.org/svn/pywps/trunk
It is recommended that you install the wps without actually touching anything for test purpose:
cd trunk python setup.py install --dry-run python setup.py install
If R functionality in python will be required, then install also rpy2 etc:
apt-get install libgdal1-dev r-base-dev apt-get install python-rpy2
In the final step, check that the pyWPS server is running by executing
We want to make sure that the cgi-bin file is configured correctly in the apache installation:
AddHandler cgi-script .cgi
To make sure everything is fine, first restart Apache:
Try if http://your-ip or domain name/pywps/pywps.cgi? is working: in /var/www/pywps/ edit index.html and replace localhost with your your-ip or domain name:
In /var/www/pywps edit pywps.cfg and replace localhost with your your-ip or domain name. Make sure that the folder names for server names etc. are correct. Copy your pywps script(s) to:
Do not forget that filename and name inside the file must be the same (!). Next, add in /var/www/pywps/processes/ in the init.py the appropiate filename without .py extension
Current trunk version on debian has some errors with templates. So on install do:
chmod -R 777 /usr/local/lib/python2.6/dist-packages/pywps/Templates
Execute all functions at least once (e.g. getcapability, execute, etc.) and afterwards change it back to
chmod -R 555 /usr/local/lib/python2.6/dist-packages/pywps/Templates
To test that pyWPS is working, try opening in your browser:
If you experience any errors, it might be helpful to look at the logs written in /var/error/apache2/error.log:
tail -f /var/log/apache2/error.log
Remember to restart Apache server from time to time and look at the error messages, e.g. script not loaded etc.
To add images to be served, first make a directory:
Next, upload your data using SCP/SFTP/WGET to that directory, and make proper permissions using chmod (!).
To install functionality, simply copy the Python scripts:
copy subset.py; sampler.py /var/www/pywps/processes/
etc. into /var/www/pywps/processes/ add in /var/www/pywps/processes/ in the init.py the appropiate filename without .py extension. Then reload the Apache server:
Check that it behaves like on your development maschine. Sometimes GDAL / pyWPS / R-project version differ and create slighly different results.