This vignette documents a initial approach to set up a shiny-based server to make SOUNDBoard reports available to users. It is derived from download on installation and configuration provided by RStudio.
Create a system-level R installation
R=/home/mtmorgan/bin/R-devel
in
/etc/init.d/shiny-server
were not successful for me.R should be on the path, e.g.,
~$ which R /usr/local/bin/R
Follow https://www.rstudio.com/products/shiny/download-server/
Create a new user
sudo adduser soundboard
Run R as soundboard, installing shiny and rmarkdown
$ sudo su - soundboard soundboard$ R > source("https://bioconductor.org/biocLite.R") > biocLite(c("shiny", "rmarkdown"))
(Workaround?) Make sure that R knows to use cairo for plotting. Do
this by adding a file ~soundboard/.Rprofile
local({ options( bitmapType = "cairo" ) })
Create directories for applications and logs, and populate with default (testing) applications
soundboard$ mkdir ~/srv/apps soundboard$ mkdir -p ~/var/log soundboard$ cp -a /srv/shiny-server/* ~/srv
From an account with sudo access, edit the configuration file
~$ sudo vi /etc/shiny-server/shiny-server.conf
Create a location entry, e.g., augmenting the default configuration
run_as shiny; server { listen 3838; # Define a location at the base URL location / { site_dir /srv/shiny-server; log_dir /var/log/shiny-server; directory_index on; } location /SOUNDBoard { run_as soundboard; site_dir /home/soundboard/srv; log_dir /home/soundboard/var/log/shiny-server; directory_index on; } }
sudo systemctl start shiny-server sudo systemctl stop shiny-server sudo systemctl restart shiny-server
Visit http://localhost:3838/SOUNDBoard
Server log
/var/log/shiny-server.log
User application logs
/var/log/shiny-server/ ~soundboard/var/log/shiny-server
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.