nginx serving R scripts via CGI/FastRWeb

Harold Sinclair haroldsinclair at gmail.com
Tue Feb 19 16:22:05 UTC 2013


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.


On Tue, Feb 19, 2013 at 9:49 AM, Stefan Parvu <sparvu at systemdatarecorder.org
> wrote:

> On 08:50 Tue 19 Feb     , Harold Sinclair wrote:
> > Does the R cgi script filename end in .cgi ? That's what you specify, it
> > appears.
>
> No, it does not end with cgi since the R scripts will not be called
> directly
> by nginx.
>
> As I understood I should call the R scripts like:
> http://localhost/cgi-bin/R/foo where
> there is a R binary file under cgi-bin which will proxy those to FastRWeb
> and Rserve R modules. So under cgi-bin there are no R scripts whatsoever,
> but they usually will go under: /opt/sdr/report/var/FastRWeb/web.R
> directory.
>
> Now my problem seems to be related how the R binary under cgi-bin will
> ever be called via CGI and further FastRWeb ... since my nginx.conf knows
> nada
> about R being called. Currently my nginx.conf is configured to run
> anything ending .cgi as cgi scripts ...
>
> /opt/sdr/report/docroot/cgi-bin
> $ ls -lrt
> total 60
> -rwxr-x--- 1 sdr sdr  3715 Feb 19 12:00 initial.cgi
> -rwxr-xr-x 1 sdr sdr 55932 Feb 19 13:53 R
>
> $ file R
> R: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
> (uses shared libs), for GNU/Linux 2.6.24,
> BuildID[sha1]=0x0351c94aaf487ee3559a722446865b7ae0f3b7cc, not stripped
>
> Here the R scripts:
>
> /opt/sdr/report/var/FastRWeb
> $ ls -lrt
> total 16
> drwxr-xr-x 2 sdr sdr 4096 Feb 18 00:08 web
> drwxr-xr-x 2 sdr sdr 4096 Feb 18 00:08 tmp
> drwxr-xr-x 2 sdr sdr 4096 Feb 19 14:27 code
> srw-rw-rw- 1 sdr sdr    0 Feb 19 14:27 socket
> =>> drwxr-xr-x 2 sdr sdr 4096 Feb 19 14:28 web.R
>
> all R scripts will go here web.R directory.
>
>
> stefan
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130219/3bd91605/attachment-0001.html>


More information about the nginx mailing list