Giter Club home page Giter Club logo

shiny-server's Introduction

Shiny Server

Authors: Komal Rathi
Contact: [email protected]
Organization: DBHi, CHOP
Status: This is "work in progress"
Date: 2024-06-16

Set up Shiny Server:

Upload all data to server

scp -r your-app-name server:/path/to/shiny-apps/

Install R

sudo yum update
sudo yum install R
sudo yum install libcurl-devel openssl-devel

Change Rprofile

sudo vi /usr/lib64/R/library/base/R/Rprofile

# add the following to the Rprofile
# download method
options(download.file.method = "libcurl")

# default CRAN mirror
local({
  r <- getOption("repos")
  r["CRAN"] <- "https://cran.rstudio.com/"
  options(repos=r)
})

Install Shiny

sudo su - -c "R -e \"install.packages('shiny')\""

Install Shiny Server

wget https://download3.rstudio.org/centos5.9/x86_64/shiny-server-1.4.4.801-rh5-x86_64.rpm
sudo yum install --nogpgcheck shiny-server-1.4.4.801-rh5-x86_64.rpm

# To manually start or stop the server, you can use the following commands.
sudo systemctl start shiny-server
sudo systemctl stop shiny-server
sudo systemctl restart shiny-server
sudo systemctl status shiny-server

# Should shiny server should be run automatically at boot time
sudo systemctl enable shiny-server
sudo systemctl disable shiny-server

# fetch all your data in corresponding app directory
# do this before installing R packages
sudo mount -o remount,exec /tmp
export TMPDIR=~/tmp # or do this. I had to do this after the latest upgrade.

# now install packages
sudo R

Edit config file to add your app

sudo vi /etc/shiny-server/shiny-server.conf

# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
preserve_logs true; # this is required to preserve logs

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

  # Define location of your app
  location /your-app-name {

    # application directory
    app_dir //;

    # log directory
    log_dir /path/to/shiny-apps/your-app-name/logs;

    # directory structure
    directory_index on;
  }
}

Turn off firewall

sudo firewall-cmd --zone=public --add-port=3838/tcp --permanent && sudo firewall-cmd --zone=public --add-port=3838/tcp

shiny-server's People

Contributors

komalsrathi avatar

Watchers

 avatar

Forkers

sultanghazala

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.