Shiny server

If you want to host the applications yourself, Shiny Server is available for Linux. Again, there are paid and free options. Shiny Server is totally free and open source, which is a great credit to Rstudio. The paid version has a number of benefits. The main ones are the provision of support and extra features, particularly authentication (LDAP/PAM/Google accounts and running over SSL to encrypt data to and from the server). It also allows you to use multiple R processes to serve one application, supports multiple versions of R on the same server, and provides an admin dashboard that helps server administrators to monitor server load, concurrent connections, and so on.

Binaries are available for Ubuntu, Red Hat, CentOS, and SUSE Enterprise; for other distributions, it is possible to build from the source. The free version is, in my experience, stable and well-featured. Installation details can be found at rstudio.com/products/shiny/download-server/.

Follow the instructions mentioned previously to install, and using the default configuration, you should be able to navigate to a test Shiny application by going to chrisbeeley.net:3838/shiny/01_hello/ in a web browser (replace the domain with your own URL). In order for Shiny Server to work, you need to open the relevant port (in this case, the default configuration, 3838) on your firewall. By default, applications are run from files located within /srv/shiny-server. You can include directories within this folder to organize your applications.The administrator's guide, which is linked to and from the download page, includes details of how to configure Shiny Server.

You may wish to change the port through which Shiny server communicates (again, opening this port on your firewall), change the location of application files, or add several locations to application files, or something else entirely. The complete details are available in the documentation. Installation on Ubuntu is embarrassingly easy; even with my limited knowledge of running Linux servers, I had it up and running on my personal server in less than an hour. It's run quite happily ever since. Mileage with other distributions will vary, although judging from forum and blog posts, people have successfully run it on a variety of distributions. Depending on what you are doing with your application, one thing to be careful of is directory ownership and permissions.

For example, one of my applications produces PDF files for download. This requires making Shiny the owner of the directory within the application folder, which houses the temporary files that are produced for download and making the directory writable. In a corporate environment, you may also find that the port Shiny uses is blocked by the firewall—changing to a different port is simply a matter of editing the configuration file as detailed on the Shiny server web page given previously. If you are in a corporate environment running Windows, it's worth noting that the open version runs fine on an Ubuntu server virtualized on Windows, in my experience. I couldn't speak for the paid version, and I'm sure RStudio would be happy to advise you if you were thinking about paying for a license.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset