简体   繁体   English

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

[英]Launch shiny application on server

I am trying to launch shiny application on server. 我正在尝试在服务器上启动闪亮的应用程序。 I just followed instruction from Administering guide: 我只是按照《管理指南》中的说明进行操作:

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

Then tried to access the hello application through http://<server-address>:3838/<your_username>/hello But it shows this page can't be displayed error. 然后尝试通过http://<server-address>:3838/<your_username>/hello访问hello应用程序,但它显示此页面无法显示错误。 Anyone has any idea about what can cause this problem? 任何人都知道什么会导致此问题? Thanks! 谢谢!

Cont. Thanks Jeff, I used the exact same part in guide. 谢谢杰夫,我在指南中使用了完全相同的部分。 Here is the shiny-server.conf file: 这是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 shows lots of error: 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

How can I fix those those error? 我该如何解决这些错误?

I assume you got that command from this portion of the guide? 我假设您从指南的这一部分得到了该命令? If so, did you also use the deploy-example script to change your configuration file? 如果是这样,您是否还使用deploy-example脚本来更改配置文件? Did you get any errors when you ran that script? 运行该脚本时是否遇到任何错误?

Alternatively, edit your question to include your configuration file at /etc/shiny-server/shiny-server.conf and we'll be able to see if your server is properly configured to use user_dirs which would be needed for users to be able to host their own applications. 或者,编辑您的问题以在/etc/shiny-server/shiny-server.conf包含您的配置文件,我们将能够查看您的服务器是否已正确配置为使用user_dirs ,这对于用户来说是必需的。托管自己的应用程序。

Also check for (and/or edit your question to include) any recent entries in the server's log at /var/log/shiny-server.log . 还要在服务器日志中/var/log/shiny-server.log检查(和/或编辑您的问题以包括)最近的条目。

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

The reason is whether the port 3838 is open. 原因是port 3838是否打开。 If it's not open, maybe you should run the following directives in your server: 如果未打开,则可能应在服务器中运行以下指令:

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