簡體   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