Apr 20, 2012

Let FastRWeb communicate via TCP/IP instead of unix sockets

Unix sockets are efficient and nice and everything, but if you want to use your Rserve installation in the most flexible way (e.g. connect through KNIME or Windows in general) you'll probably prefer a TCP/IP connection. It is easy enough to set Rserve up to use TCP/IP, but before you can start with FastRWeb you need to convince the CGI client to use the right protocol. In order to do this just find the folder where R has put FastRWeb (in R just type: system.file("cgi-bin", package="FastRWeb") ) and then find the source files for the client in a subfolder called Rcgi. There is a file Rcgi.cc you need to edit. Read the comments where Simon Urbanek explains how to set RSERVE_HOST and RSERVE_PORT, compile with the make command, copy the new client Rcgi to your CGI-BIN folder and you're good to go!

FastRWeb on CentOS

The last two days I was trying to get FastRWeb to work on my CentOS 6 installation. I tried virtually everything and learned a lot about how FastRWeb is structured and how Rserve is configured in the process.

James Emerson gives a perfect example of how to install FastRWeb on Ubuntu in his Blog. Follow this and you can set up FastRWeb on any linux distribution in no time (assuming you know your apache paths). On my CentOS installation I keep running into connection errors from both CGI and PHP client. After trial and error I could at least establish a TCP/IP connection: The problem is that in SElinux default settings (which seem stricter on CentOS) a network connection from a CGI script is NOT allowed. You can change this setting with just one command:

A unix socket connection however does not work for me. I'll keep trying.