在shiny-server.conf中运行run_as

时间:2014-08-06 23:58:42

标签: r shiny shiny-server

正如您在下面看到的包含" run_as zza025;"的shiny-server.conf文件。在第二行。但问题是所有应用程序都使用此给定的用户ID运行。我们构建的所有应用程序都使用此ID运行,并且所有日志都使用相同的ID创建。有没有办法,如果不同的应用程序可以使用自己的ID而不是使用相同的ID?

我是否需要为每个具有自己的应用程序ID的应用程序提供单独的shiny-server.conf?

shiny-server]$ more shiny-server.conf
# Instruct Shiny Server to run applications as the user "shiny"
run_as zza025;

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

任何想法都将受到高度赞赏。

谢谢!

Tinku。

1 个答案:

答案 0 :(得分:1)

您可以在位置块内使用run_as,并且可以为应用程序配置每个位置块。

location /users {
  run_as :HOME_USER:;
  user_dirs;
}

location /apps {
  run_as shiny;
  site_dir /srv/shiny-server;
  log_dir /var/log/shiny-server;
  directory_index on;
}

使用此链接获取更多文档: http://rstudio.github.io/shiny-server/latest/#home_user