Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change default path of shiny server directory

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?

like image 561
pogibas Avatar asked Jul 14 '17 18:07

pogibas


People also ask

Where is Shiny server config?

Most users will want to customize the configuration to meet their needs. The server will load its configuration from a file stored at /etc/shiny-server/shiny-server. conf ; it is in this file that you should customize your Shiny Server configuration.

Where is the Shiny app directory?

Shiny apps are contained in a single script called app. R . The script app. R lives in a directory (for example, newdir/ ) and the app can be run with runApp("newdir") .

Why is R Shiny so slow?

There are many reasons why a shiny app runs slower than expected. The most common reason is the Shiny app code has not been optimized. You can use the profvis package to help you understand how R spends its time. You also might want to make sure your server is large enough to host your apps.


1 Answers

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?

like image 83
Florian Avatar answered Sep 24 '22 08:09

Florian