-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrstudioserver
44 lines (37 loc) · 1.48 KB
/
rstudioserver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# References:
# https://www.linode.com/docs/development/r/how-to-deploy-rstudio-server-using-an-nginx-reverse-proxy/
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04
# have R and rstudio
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
apt install r-base
add-apt-repository ppa:certbot/certbot
apt install python-certbot-nginx nginx
# edit server_name in /etc/nginx/sites-available/default
nginx -t
systemctl reload nginx
certbot --nginx -d SERVER.NAME
# edit:
# nginx.conf under http {}
# map $http_upgrade $connection_upgrade {
# default upgrade;
# '' close;
# }
# available-sites/default: change "secret" to something else
# rewrite ^/secret$ $scheme://$host/secret/ permanent;
# location /secret/ {
# rewrite ^/secret/(.*)$ /$1 break;
# proxy_pass http://localhost:8787/;
# proxy_redirect http://localhost:8787/ $scheme://$host/secret/;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $connection_upgrade;
# proxy_read_timeout 20d;
#
# }
# cat /etc/rstudio/rserver.conf
# Server Configuration File
www-address=127.0.0.1
# cat /etc/rstudio/rsession.conf
# R Session Configuration File
session-timeout-minutes=30