13

I'm trying to set up a shiny server. I need to change default directory of Shiny apps (to avoid sudo permissions).

I changed original shiny-server.conf to:

#CHANGED;
run_as userA;

server {
  listen 3838;

  location / {

    # CHANGED
    site_dir /home/userA/shiny-server;

    # CHANGED
    log_dir /home/userA/shiny-server_log;

    directory_index on;
  }
}

However, address:3838 gives error:

An error has occurred

Invalid application configuration.

EACCES: permission denied, stat '/home/userA/shiny-server'

Question: How can configure shiny-server.conf to work with wanted directory?

pogibas
  • 27,303
  • 19
  • 84
  • 117
  • I have a similar configuration file running with no problems. It seems `userA` is not allowed to read the contents of `/home/userA/shiny-server`. Have you tried changing the permissions with something like `chmod`? Can you access the directory with `su userA; ls /home/userA/shiny-server`? – Gregor de Cillia Jul 15 '17 at 19:51
  • @GregordeCillia permissions for `/home/userA/shiny-server` are `drwxrwxrwx` – pogibas Jul 17 '17 at 13:46
  • Can you give us the output of `ls -la /home/userA/shiny-server` pls. My best guess is that you gave rights to `userA` and not to the shiny user. Florian´s quote of the docu is of course correct, but i think you followed all that already for `userA`,... and the "twist" in your case is that you should do it also for the user: "shiny". – Tonio Liebrand Jul 18 '17 at 11:37
  • any news here,...? – Tonio Liebrand Jul 22 '17 at 13:50

1 Answers1

8

According to the Documentation:

Running Shiny Server as another user will require that you adjust the permissions to grant this other user the necessary privileges to run Shiny Server. In particular, ensure that the user has write privileges on these paths (recursively):

  • /var/lib/shiny-server/ (or whatever custom SHINY_DATA_DIR setting you are using)
  • /var/log/shiny-server/ (and/or whatever other directories you use for logging)

and read privileges on these paths (recursively):

  • /srv/shiny-server/ (and/or whatever other directories you are using to host Shiny applications)
  • /opt/shiny-server/
  • /etc/shiny-server/ (Note that you should enable only read access on this directory, as you likely don't want to allow your Shiny applications (which also run as shiny) to be able to write to your configuration or password file.)

Do you currently have those permissions set properly?

Florian
  • 24,425
  • 4
  • 49
  • 80