Version 17 (modified by cedric, 6 years ago) (diff) |
---|
Installation of a shiny server
https://www.rstudio.com/products/shiny/download-server/
sudo apt-get update sudo apt-get install openssh-server sudo apt-get install r-base sudo su - \ -c "R -e \"install.packages('shiny', repos='https://cran.rstudio.com/')\"" sudo apt-get install gdebi-core wget https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.7.907-amd64.deb sudo gdebi shiny-server-1.5.7.907-amd64.deb
The server is accessed by putty : https://mediatemple.net/community/products/dv/204404604/using-ssh-in-putty-
=> 192.168.1.164 use default port 22 to access via putty, you will be prompted for a username and password
The server runs in local in 192.168.1.164:3838
Installation of markdown
sudo su - -c "R -e \"install.packages('rmarkdown')\""
> install.packages('rmarkdown') Installation du package dans ‘/usr/local/lib/R/site-library’ (car ‘lib’ n'est pas spécifié) installation des dépendances ‘highr’, ‘markdown’, ‘backports’, ‘glue’, ‘stringi’, ‘knitr’, ‘yaml’, ‘evaluate’, ‘base64enc’, ‘rprojroot’, ‘tinytex’, ‘stringr’ essai de l'URL 'https://cloud.r-project.org/src/contrib/highr_0.7.tar.gz' Content type 'application/x-gzip' length 17505 bytes (17 KB) ================================================== downloaded 17 KB ...
Other packages
sudo apt-get install libcurl4-openssl-dev sudo su - -c "R -e \"install.packages('curl')\"" sudo su - -c "R -e \"install.packages('tidyverse')\"" sudo apt-get install libssl-dev sudo su - -c "R -e \"install.packages('openssl')\"" sudo apt-get install libxml2-dev sudo su - -c "R -e \"install.packages('xml2')\"" httr sudo su - -c "R -e \"install.packages('httr')\"" sudo su - -c "R -e \"install.packages('rvest')\"" sudo apt install default-jre
rvest sudo su - -c "R -e \"install.packages('rvest')\"" devtools sudo su - -c "R -e \"install.packages('devtools')\"" sudo su - -c "R -e \"devtools::install_github('cttobin/ggthemr')\"" these packages must also be installed sudo su - -c "R -e \"install.packages('magrittr')\"" sudo su - -c "R -e \"install.packages('pipeR')\"" sudo su - -c "R -e \"install.packages('viridis')\"" sudo su - -c "R -e \"install.packages('DT')\"" sudo su - -c "R -e \"install.packages('leaflet')\"" sudo su - -c "R -e \"install.packages('shinyBS')\"" sudo su - -c "R -e \"install.packages('shinyWidgets')\"" sudo su - -c "R -e \"install.packages('shinydashboard')\"" sudo su - -c "R -e \"install.packages('plotly')\""
Import the data and application to the server. Be sure to save all data in a data subfolder
cd\ cd srv/shiny-server
The above configuration instructs Shiny Server to make the /srv/shiny-server/ directory available at the base URL (/). Any Shiny applications stored in this directory (or its subdirectories), along with any static assets (including images, data, JavaScript?/CSS files, etc.), will be made available at the corresponding URL. For example, see the following directory tree:
+---/srv/shiny-server | +---shinyApp1 | +---server.R | +---ui.R | +---shinyApp2 | +---server.R | +---ui.R | +---assets | +---style.css | +---script.js
If this server were available at http://server.com, the location settings above would make the following publicly available to the user, along with any other file in the tree:
URL Definition http://server.com/shinyApp1 Serve the Shiny App defined in 'shinyApp1' http://server.com/shinyApp2 Serve the Shiny App defined in 'shinyApp2' http://server.com/assets/style.css Serve this static CSS file http://server.com/assets/script.js Serve this static JS file