在Apache服务器上运行R Shiny App

问题描述:

我有一个Shiny应用程序,希望在现有的Apache服务器上运行.我对服务器是完全陌生的,并且对从哪里开始一无所知.不幸的是,我在网上找到的大多数资源都是关于NGINX而不是Apache.

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.

我知道这样的事情是可能的,但是我不确定如何开始.如何开始在Apache服务器上托管自己的Shiny应用程序?

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?

因此,您不要在Apache上运行Shiny应用程序,Shiny Apps必须在Shiny Server上运行.您可以通过多种选择将Shiny应用程序部署到您的网站.最简单的方法是将您的应用发布到Shinyapps.io,然后将IFrame添加到您的网站,该IFrame将显示您已部署的Shiny应用.

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.

由于您已经询问如何在Apache上运行Shiny App,因此我假设您要部署自己的Shiny Server,可以将其与Apache服务器部署在同一台计算机上,也可以部署在另一台计算机上.可以在以下位置找到执行此操作的说明: https://www.rstudio.com/products/shiny/download-server/

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/

一旦安装了闪亮的服务器,您将需要在此发布您的应用程序.这是通过将r文件移动到Shiny Server上的适当位置来完成的.有关详细信息,请参见: http://docs.rstudio. com/shiny-server/#host-a-directory-of-applications-1

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

完成此操作并使您的应用程序在Shiny Server上运行后,您需要设置Apache(Nginx或其他Web服务器)以充当Shiny Server的代理.这是一个引导您完成步骤的链接: https://support.rstudio.com/hc/zh-CN/articles/213733868-Running-Shiny-Server-with-a-Proxy

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

如果您以前没有做过此事,并且没有使用Linux或服务器的经验,那么我希望它至少需要4个小时.

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.