从浏览器查看我的闪亮页面

时间:2014-04-25 01:24:37

标签: r amazon-ec2 shiny

我在Amazon EC2上运行了一个64位的ubuntu实例,然后按照here的说明运行shiny server(对于R)。接下来我跑了

cd /var/shiny-server/www
sudo git clone https://github.com/trestletech/shiny-sandbox.git .

按照指示here将简单的示例闪亮应用程序置于闪亮服务器的触及范围内。 (我还使用scp将第二套玩具闪亮的应用程序文件server.Rui.R移动到我主目录中的文件夹中。)

最后,我想从浏览器访问我的闪亮应用程序,就像我是普通的Web用户一样。然而(显然)我几乎都不知道网页,服务器和地址是如何共同使互联网发挥作用的。 如何访问我的服务器/应用程序?

This page建议进入

http://<your amazon machine name>:3838/

在浏览器中。我已经尝试用<your amazon machine name>代替公共和私有IP地址,我的亚马逊“实例ID”,我的“公共DNS”中的几个东西,但这些都不会导致网页加载。

2 个答案:

答案 0 :(得分:3)

您需要检查的几件事情:

  1. 尝试this guide而不是您引用的那个。您提供的链接较旧,建议使用不再使用的旧目录(/var/...)。如今,shine-server希望您的应用程序能够托管在/srv/shiny-server中。实际上,如果您使用的是最近发布的Shiny Server 1.1版,那么http://<server address>:3838/应该有一些内容,而您甚至无需部署任何应用程序。但是,当然,您可以先设置应用程序。
  2. 在EC2上,您需要担心控制机器访问方式的“安全组”。特别是,您需要确保服务器上的端口3838已打开。
  3. 您的“公共DNS”条目可能是访问您服务器最安全的方式。
  4. 如果您还没有运气,可以查看服务器登录/var/log/shiny-server.log以查看是否有任何有用的错误消息并将其发回此处。

答案 1 :(得分:1)

有一些过时的博客文章,所以第一次安装不可避免地最终被终止..正如杰夫提到的,闪亮将寻找/ srv中的应用程序。试试这个:sudo cp -R /usr/local/lib/R/site-library/shiny/examples/01_hello /srv/shiny-server/另外,也许有用,对于Ubuntu 12.04你在安装R之前是否整理了sources.list文件?可以在终端中复制粘贴。

########################################
# UBUNTU CONFIG 
######################################## 
# useful: http://withr.me/blog/2013/07/23/configure-shiny-server-under-ubuntu/
## Unlike other Linux, need to follow the following steps to install R on Ubuntu:
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
## Open sources.list, and add the repository deb http://<myFAVcran>/linux/ubuntu precise/ to its end, 
deb http://cran.csiro.au/bin/linux/ubuntu precise/
## Where precise means the R version for Ubuntu 12.04. 
## Note, if you use ‘nano’ as the editor, press Ctrl+X to exit nano editor and press Y to save the change, then press Enter.
sudo nano /etc/apt/sources.list
## Update Ubuntu, and install R.
sudo apt-get update
sudo apt-get install r-base r-base-dev
相关问题