Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shiny-server安装和配置 #10

Open
ShixiangWang opened this issue Dec 9, 2023 · 1 comment
Open

shiny-server安装和配置 #10

ShixiangWang opened this issue Dec 9, 2023 · 1 comment
Assignees
Labels

Comments

@ShixiangWang
Copy link
Member

参考博文在Ubuntu服务器上配置Shiny应用进行基本的安装和配置。注意 zhoulab 服务器没有将 shiny 加入 sudo 用户,而是直接使用 root 进行相关的 sudo 操作。

shiny server 配置文件内容:

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
preserve_logs true;
app_idle_timeout 0;
# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # 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;
  }
}

主要是增加了第3行和第4行,其他的没动过。

nginx 的配置参考文章shiny应用的nginx配置

@ShixiangWang ShixiangWang self-assigned this Dec 9, 2023
@ShixiangWang
Copy link
Member Author

app_idle_timeout 0; 可能不太合适。之前是想避免 app 经常断线,现在fusion的app测试发现会导致session一直在工作,可能会影响代码更新和自动加载新的网页(待测试),所以改成 3600 s。

app_idle_timeout -- Defines the amount of time (in seconds) an R process with no active connections should remain open. After the last connection disconnects from an R process, this timer will start and, after the specified number of seconds, if no new connections have been created, the R process will be killed. The default value for app_idle_timeout is 5 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant