0

正如您在下面看到的包含“run_as zza025;”的 shiny-server.conf 文件 在第 2 行。但问题是所有应用程序都使用这个给定的用户 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;
}
}

任何想法将不胜感激。

谢谢!

廷库

4

1 回答 1

1

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

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

于 2015-04-07T19:53:56.077 回答