CentOS8下安装和配置Rstudio-Server并使用Nginx实现SSL加密

文章目录[隐藏]

前言

实在受不了国内容器云的访问速度,于是在德国节点打算新建一个Rstudio服务器自用。CentOS8出来也有一段时间了,就用新版的CentOS8试试水吧。

安装R的依赖环境

首先需要安装epel库:



yum install sudo wget -y && sudo yum install epel-release -y && yum update -y

安装Rstudio之前需要安装好R,这里偷懒就直接安装yum源里面的版本了,有需要的可以自行选择并编译安装:



sudo yum install R -y

这里出现了问题:



[root@rstudio ~]# sudo yum install R -y

Extra Packages for Enterprise Linux Modular 8 - x86_64                               59 kB/s |  40 kB     00:00    

Error: 

 Problem: package R-3.6.2-1.el8.x86_64 requires R-devel = 3.6.2-1.el8, but none of the providers can be installed

  - package R-devel-3.6.2-1.el8.x86_64 requires R-core-devel = 3.6.2-1.el8, but none of the providers can be installed

  - conflicting requests

  - nothing provides texinfo-tex needed by R-core-devel-3.6.2-1.el8.x86_64

(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

发现是缺少了texinfo-tex,而这个包在CentOS8下的powertools repo中,而且并没有被默认开启,因此需要手动开启:



dnf install 'dnf-command(config-manager)' -y

sudo yum config-manager --set-enabled PowerTools

开启完成后再次安装R成功:



sudo yum install R -y

安装Rstudio

在官网下载最新版本的RstudioServer安装包:https://rstudio.com/products/rstudio/download-server/redhat-centos/
其中CentOS8和之前发行版本的不同,要注意下:



wget https://download2.rstudio.org/server/fedora28/x86_64/rstudio-server-rhel-1.2.5033-x86_64.rpm

sudo yum install rstudio-server-rhel-1.2.5033-x86_64.rpm -y

然后重启Rstudio-Server并设置开机启动:



systemctl restart rstudio-server

systemctl enable rstudio-server

此时应该可以在http://IP:8787访问Rstudio网页了



[root@rstudio ~]# lsof -i:8787

COMMAND  PID           USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME

rserver 5579 rstudio-server    6u  IPv4 2446597      0t0  TCP *:msgsrvr (LISTEN)

使用Nginx转发实现SSL加密

Rstudio和Shiny都是需要使用到WebSocket的,因此需要在nginx里开启这个模块,具体可以参考:
https://www.liujason.com/article/529.html


This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/530.html
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy