The good thing is it manages multiple connections in a clean way. It creates a separate workspace and a directory for every connections. So, each connection is independent of others. Another good thing is several client-side implementations are available including C/C++, Java, PHP.
Recently, I used it with PHP. It works great. You may start RServe as a daemon (using the function Rserve()) or from your R session with your current session available to all connections (using the function run.Rserve()).
While I was working on integrating R with PHP via Rserve, I was struggling to have write permission in the Rserve folder. I found that both Rserve and Apche Server have to be run by the same user and group. Both Apache and Rserve has to be configured for this purpose.
Apache Config:
1. Edit /etc/apache2/envvars
export APACHE_RUN_USER=ashis
export APACHE_RUN_GROUP=ashis
export APACHE_RUN_GROUP=ashis
2. You may have to change the ownership of the /var/locks/apache2 folder.
sudo chown -R ashis:ashis /var/locks/apache2/
id ashis
2. Edit /etc/Rserve.conf file
uid UID_OF_USER
gid GID_OF_USER
Finally, You have to restart both apache and Rserve.
great
ReplyDelete