====== R, RStudio server ====== * R is a free software environment for statistical computing and graphics. ([[http://www.r-project.org/|site]]) Add to /etc/apt/sources.list.d/erre.list this line: deb http://cran.rstudio.com/bin/linux/ubuntu xenial/ then # gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 # gpg -a --export E084DAB9 | sudo apt-key add - # apt-get update # apt-get install r-base r-base-dev Enter R at prompt: R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) \\ * RStudio IDE is a powerful and productive user interface for R. It’s free and open source. ([[http://www.rstudio.com|site]]) Download and install # apt-get install gdebi-core # wget https://download2.rstudio.org/rstudio-server-1.0.136-amd64.deb # gdebi rstudio-server-1.0.136-amd64.deb Configure reverse-proxy https # apt-get install apache2 # a2enmod proxy proxy_http proxy_wstunnel # a2enmod ssl rewrite # a2ensite default-ssl.conf # a2dissite 000-default.conf # nano -w /etc/apache2/sites-available/default-ssl.conf Allow from localhost # root path # RewriteEngine on # RewriteCond %{HTTP:Upgrade} =websocket # RewriteRule /(.*) ws://localhost:8787/$1 [P,L] # RewriteCond %{HTTP:Upgrade} !=websocket # RewriteRule /(.*) http://localhost:8787/$1 [P,L] # ProxyPass / http://localhost:8787/ # ProxyPassReverse / http://localhost:8787/ # ProxyRequests Off # /rstudio/ path RewriteEngine on RewriteCond %{HTTP:Upgrade} =websocket RewriteRule /rstudio/(.*) ws://localhost:8787/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket RewriteRule /rstudio/(.*) http://localhost:8787/$1 [P,L] ProxyPass /rstudio/ http://localhost:8787/ ProxyPassReverse /rstudio/ http://localhost:8787/ ProxyRequests Off # service apache2 restart Limit connection from localhost nano -w /etc/rstudio/rserver.conf www-address=127.0.0.1 rstudio-server stop rstudio-server start