I am trying to host an app over the web using R
, shiny
and shiny-server
. As a preface, I have only used Linux OS (of any flavor) for a day-or-two and have no networking experience. So please bear with me. And I apologize in advance if I've overlooked something that is incredibly simple.
I followed the examples given in the links below to install Ubuntu 12.04, R (precise), shiny and shiny-server.
- http://withr.me/blog/2013/07/23/configure-shiny-server-under-ubuntu/
- https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions
All the commands execute fine with no complaints. Ubuntu appears to have installed fine. R runs fine. All the R libraries install. I can host shiny applications locally using runApp
and runGist
pointing to appropriate file locations.
As a test, I copy the shiny examples to shiny-server/www
folders:
sudo cp -R /usr/local/lib/R/site-library/shiny/examples /var/shiny-server/www/
If I open R in the terminal, and run the following code. Things run fine.
runApp("/var/shiny-server/www/examples/01_hello/")
This time the app runs in http://localhost:4251/
. One weird thing I notice is that if I quit R and run the same code in a new session, the app runs in a different "port" (i.e. not 4251). Maybe this is usual behavior in Ubuntu??? But coming from Windows I am used to the app always running in the same http://localhost:8100/
.
Now when I try:
sudo start shiny-server
. And try to open the same example over the web (i.e. not locally in R). One thing I notice is that the process always starts at a different "port". This time it is shiny-server start/running, process 4463
. But this process number changes with every sudo start shiny-server
and sudo stop shiny-server
sequence. And is not 3838
like I would expect from the example documents cited above. Is this normal?
With the server started, if I try (replacing hostname with my IP address) to enter the following URL (in Firefox) I get:
http://<hostname>:3838/examples/
Results in "Page not found Error".http://<hostname>:4463/examples/
Results in "Unable to Connect to Server Error"
Do the hints given above provide enough information for determining what I am doing wrong in setting up shiny-server?
Do I need other software/libraries installed besides Ubuntu 12.04, R, shiny, shiny-server, node.js, upstart script, etc. listed in the posts above?
I am running all of the above off a standalone desktop style machine, itself part of a larger Departmental network (at University). Is my departments network firewall, or my personal firewall blocking my access? How would I disable/adjust settings if this is the case in Ubuntu?
Really I'm a rookie and have no idea why it's not working, and would appreciate any help the group could provide. Thanks in advance, and below is the version of R, shiny and shiny-server I am using:
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rCharts_0.3.51 shiny_0.8.0
loaded via a namespace (and not attached):
[1] bitops_1.0-6 caTools_1.16 digest_0.6.3 grid_3.0.2
[5] httpuv_1.2.0 lattice_0.20-24 plyr_1.8 Rcpp_0.10.6
[9] RJSONIO_1.0-3 tools_3.0.2 whisker_0.3-2 xtable_1.7-1
[13] yaml_2.1.8
This is where/how I got shiny-server http://www.rstudio.com/shiny/server/install-opensource