nginx serving R scripts via CGI/FastRWeb

Stefan Parvu sparvu at
Tue Feb 19 16:38:48 UTC 2013

On 11:22 Tue 19 Feb     , Harold Sinclair wrote:
> Sounds like you ought to try writing a wrapper script ending in .cgi in the
> cgi dir that grabs the query string and hands the job off to the R
> executable. Not sure if R is required in the cgi-bin directory. You might
> have to enable symlinking out for it to work.

yeah not sure how to do it. FastRWeb tell us:

" FastRWeb consists of several parts:

    Webserver-to-R pipeline, consisting of either a thin CGI or a PHP client connecting to Rserve which sources and runs the R script. The CGI client is called Rcgi and is compiled as part of the package. The PHP client is part of Rserve in the clients section.

So Im on option 1: CGI. The client will be this binary which somehow needs to be 
executed for each R script. I placed the Rcgi under cgi.bin directory and rename it
as R.cgi.

If I call directly:

 http://localhost:9001/cgi-bin/R.cgi the browser returns:
  Error: no function or path specified.

  I see under error log:
  2013/02/19 18:39:53 [error] 2847#0: *56 open() "/opt/sdr/report/docroot/cgi-bin/R.cgi/foo.png" failed (20: Not a directory), client:, server: sdrrep, request: "GET /cgi-bin/R.cgi/foo.png?n=100 HTTP/1.1", host: "localhost:9001"


More information about the nginx mailing list