r - How to configure FastRWeb to use RServer built-in web server -
i'm new rserve (and fastrweb). installed rserve 1.7.0 want use built-in webserver. have apache running on machine want run rserve/fastrweb on custom port.
i did cd /usr/local/lib/r/site-library/fastrweb;sudo ./install.sh
, created /var/fastrweb/ directory tree.
i'm not seeing configuration file mentions port. default /var/fastrweb/code/rserve.conf looks this:
socket /var/fastrweb/socket sockmod 0666 source /var/fastrweb/code/rserve.r control enable
i'm guessing means uses unix sockets, default? think question exactly have put in (and remove from) file to, say, have listen on tcp port 8888? , there else need do? (i want able connect other machines, not localhost.)
possibly related, i've looked @ /var/fastrweb/web/index.html , contains javascript going connect /cgi-bin/r/
path specific when using apache, or going fine, as-is, when using rserve?
there explanation of setting port in rserve 1.7.0 release announcement. therefore, @ top of rserve.conf, added line: http.port 8888
used start
script (as root), start it.
this got me halfway http://127.0.0.1:8888/
works, gives me page says:
error in try(.http.request("/", null, null, c(48, 6f, 73, 74, 3a, 20, : not find function ".http.request"
the second half of solution add top of /var/fastrweb/code/rserve.r:
library(fastrweb) .http.request <- fastrweb:::.http.request
then start things going running /var/fastrweb/code/start
. there no default handler, can test http://127.0.0.1:8888/info
. or more interesting example http://127.0.0.1:8888/example1.png
(to view chart) or http://127.0.0.1:8888/example2
(to view mix of html , chart)
note: did not delete or edit other configuration working. means have unix socket listening. if not needed remove 2 lines rserve.conf file.
if want listening on ip addresses, not localhost, add remote enable
rserve.conf file. note: make sure understand security consequences before opening server world.
so, after 2 changes, /var/fastrweb/code/rserve.conf
file looks like:
http.port 8888 remote enable source /var/fastrweb/code/rserve.r control enable
Comments
Post a Comment