繁体   English   中英

在服务器上启动闪亮的应用程序

[英]Launch shiny application on server

我正在尝试在服务器上启动闪亮的应用程序。 我只是按照《管理指南》中的说明进行操作:

mkdir ~/ShinyApps
sudo cp -R /opt/shiny-server/samples/sample-apps/hello ~/ShinyApps/

然后尝试通过http://<server-address>:3838/<your_username>/hello访问hello应用程序,但它显示此页面无法显示错误。 任何人都知道什么会导致此问题? 谢谢!

谢谢杰夫,我在指南中使用了完全相同的部分。 这是shiny-server.conf文件:

server {
  listen 3838;

  # Define a location at the base URL

  location /users {
      #this is set up so that I can run apps sithout sudo
      run_as :HOME_USER:
      user_dirs;
  }
  location /apps {
    run_as shiny;
    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;
  }
}

Shiny-server.log显示很多错误:

[32m[2014-04-28 11:04:42.871] [INFO] shiny-server - [39mShiny Server v1.1.0.10000 (Node.js v0.10.21)
[32m[2014-04-28 11:04:42.875] [INFO] shiny-server - [39mUsing pidfile /var/run/shiny-server.pid
[32m[2014-04-28 11:04:42.877] [INFO] shiny-server - [39mUsing config file "/etc/shiny-server/shiny-server.conf"
[33m[2014-04-28 11:04:42.973] [WARN] shiny-server - [39mRunning as root unnecessarily is a security risk! You could be running more securely as non-root.
[31m[2014-04-28 11:04:42.217] [ERROR] shiny-server - [39mError loading config: location directive must contain (or inherit) one of site_dir, user_apps, app_dir, or redirect (/etc/shiny-server/shiny-server.conf:10:3)
[32m[2014-04-28 11:04:42.218] [INFO] shiny-server - [39mShutting down worker processes

我该如何解决这些错误?

我假设您从指南的这一部分得到了该命令? 如果是这样,您是否还使用deploy-example脚本来更改配置文件? 运行该脚本时是否遇到任何错误?

或者,编辑您的问题以在/etc/shiny-server/shiny-server.conf包含您的配置文件,我们将能够查看您的服务器是否已正确配置为使用user_dirs ,这对于用户来说是必需的。托管自己的应用程序。

还要在服务器日志中/var/log/shiny-server.log检查(和/或编辑您的问题以包括)最近的条目。

尝试使用URL http://<server-address>:4949/sample-apps/ 如果不是4949,请尝试3838。

原因是port 3838是否打开。 如果未打开,则可能应在服务器中运行以下指令:

iptables -I INPUT -p tcp --dport 3838 -j ACCEPT
iptables -I INPUT -p gre -j ACCEPT

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM