Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run R Shiny App on Apache Server

Tags:

r

apache

shiny

I have a Shiny app that I would like to run on an existing Apache server. I am completely new to servers and don't have much idea of where to start. Unfortunately most of the resources I've found online have been about NGINX and not Apache.

I know something like this is possible, but I am not sure how to start. How can I get started with hosting my own Shiny app on an Apache server?

like image 602
tsouchlarakis Avatar asked Apr 20 '17 18:04

tsouchlarakis


1 Answers

So you don't run a Shiny app on Apache, Shiny Apps must be run on a Shiny Server. You have several options for deploying a Shiny app to your website. The simplest approach is to publish your app to shinyapps.io then add an IFrame to your website that will display your deployed Shiny app.

Since you have asked about how to run a Shiny App on Apache, I assume you want to deploy your own Shiny Server, which can be deployed on the same machine as your Apache server or on a different machine. Instructions for doing this may be found here: https://www.rstudio.com/products/shiny/download-server/

Once you shiny server is installed you will need to publish your app there. This is accomplished by moving your r files to the appropriate location on your Shiny Server. For details see: http://docs.rstudio.com/shiny-server/#host-a-directory-of-applications-1

Once you have done this and have your app running on Shiny Server, you need to set up Apache(Nginx or another webserver) to act as a proxy to Shiny Server. Here is a link that walks you through the steps: https://support.rstudio.com/hc/en-us/articles/213733868-Running-Shiny-Server-with-a-Proxy

If you have not done this before and do not have experience with Linux or servers, I would expect it to take at least 4 hours.

like image 135
Ian Wesley Avatar answered Oct 02 '22 00:10

Ian Wesley