Install WPS4R on Debian
This tutorial shows the steps to install WPS4R
on a Linux server, including R.
1) Configure Rserve
sudo nano /etc/Rserv.conf
Add (at least) the following two lines:
For more configuration options see http://www.rforge.net/Rserve/doc.html
2) Start Rserve Daemon (optional)
Type the following command to start Rserve.
R CMD Rserve
You should get some output ending in "Rserve started in daemon mode." For details see http://www.rforge.net/Rserve/faq.html
To check if Rserve is already running type
ps ax|grep Rserve
Alternatively, you can let the WPS start Rserve, which results in the user running the WPS, e.g. user
, also executing the Rserve command. This has to be taken into account when configuring directories and access rights.
If you get the message "Rserve not found", then install the package within an R session run by sudo so that all users can access the extension package.
Test your Rserve connection by typing the following command:
telnet localhost 6311
You should get output containing "Connected to localhost.". You can return to the prompt by hiting the enter key.
3) Configure WPS
By default, the WPS configuration file is quite limited and you must activate WPS4R processes.
Open the configuration file:
sudo nano /home/tomcat7/wps_config.xml=
Snd set the XML-property
so that the file contains the following line.
While you are at it, you might also want to disable other repositories.
You can also change all WPS4R related settings in this file, such as the Rserve port. For complete documentation of the settings see
Restart the Tomcat (e.g. with
sudo /etc/init.d/tomcat7 restart
4) Test WPS4R
Open the WPS landing page, select the "wps-js" test client. Then under "Execute Process" select the process
in the dropdown menu. In the appearing menu, enter some words in the input field "InputVariable", select the checkbox next to "OutputVariable". Then click "Execute". In the appearing new section, click the button in the top left corner to refresh the status and inspect the response.
Find documentation on how to configure the WPS here:
- R: You should check the RServe documentation and the recommended security measures. If possible, disable remotes connections.
- WPS4R: WPS4RDocumentation
- With a manualbasedir working directory configuration, you have to set the permissions of that directory to
chmod 777 or by giving read/write/execute access to the users that run Tomcat and Rserve.
- [currently buggy with processes that return files] With a preset working directory configuration, the WPS4R workdirs are created in
- WPS: ConfiguringTheWPS
Installing R Task Views
The R package
provides a great way to prepare your WPS4R server for whatever is coming you way with respect to scripts. You can run R as sudo to install the commonly used packages for all users and keep control of the update schedule. However, some packages require specific libraries to be installed which are listed in the following table (as of 2014-06-24).
You can run a sequence of first
to install all the required dependencies.
| Task view || package ||libraries |
|Spatial ||rgeos ||sudo apt-get install libgeos-dev libgeos-doc |
|XML ||sudo apt-get install libxml2-dev |
|rgdal ||sudo apt-get install gdal-bin libgdal-dev libproj-dev |
|ncdf ||sudo apt-get install netcdf-bin netcdf-doc |
|rJava ||sudo R CMD javareconf |
|rgl ||sudo apt-get install libglu-mesa-dev |
|gsl ||sudo apt-get install gsl-bin libgsl0-dev |
|tkrplot ||sudo apt-get install r-cran-tkrplot tcl8.5-dev tk8.5-dev |
|SpatioTemporal ||RNetCDF ||sudo apt-get install libudunits2-dev |
|rpanel, lgcp ||http://stackoverflow.com/questions/21729873/r-having-trouble-installing-rpanel |
|spate ||sudo apt-get install libfftw3-dev |
|WebTechnologies ||(SSOAP) ||only available on Bioconductor for R 3.1.0 |
|RCurl ||sudo apt-get install libcurl4-openssl-dev |
|TimeSeries ||gmp ||sudo apt-get install libgmp-dev |
|SDD ||needs rpanel (see above) |
|Rmpfr ||sudo apt-get install libmpfr-dev |
|rjags ||sudo apt-get install jags |
|cairoDevice ||needs X11 |
|RGtk2 ||sudo apt-get install r-cran-rgtk2 libgtk2.0-dev |
|x12GUI ||user interface only |