查看原文
其他

CentOS 7系统如何安装Rstudio-server

基因学苑 基因学苑 2023-08-18

由于RHEL 7系统中,采用firewalld防火墙去掉了传统的iptables防火墙,因此对于安装Rstudio-server会与RHEL 6系统或者Ubuntu不同,安装Rstudio之后,其他设备是无法通过网络登录Rstudio的,这就需要修改防火墙,本次推文,我们将详细介绍如何在RHEL 7系统,包括CentOS系统中,安装和使用Rstudio-server。

安装R

在RHEL 7中安装R比Ubuntu系统中要容易很多,虽然Ubuntu中可以利用apt安装r-base,但是这个R的版本并不是最新版的,在RHEL 7中,只需要添加epel源,就可以直接通过yum安装最新版的R。

yum install -y epel-release
yum install -y R

安装Rstudio

这里选择下载安装免费版的Rstudio-server,我们选择使用RedHat/CentOS系统64位版本的rpm包。
链接地址:https://www.rstudio.com/products/rstudio/download-server/
注意必须使用管理员root账户安装。

#安装Rstudio
wget https://download2.rstudio.org/rstudio-server-rhel-1.1.463-x86_64.rpm
sudo yum install rstudio-server-rhel-1.1.463-x86_64.rpm

校验安装是否成功

$ rstudio-server verify-installation
$ rstudio-server status

修改防火墙

默认防火墙是关闭8787窗口,需要手动开启这个端口,RHEL 7系统采用systemctl命令来进行处理。

systemctl enable rstudio-server.service
systemctl start rstudio-server.service
systemctl status rstudio-server
firewall-cmd --permanent --add-port=8787/tcp
firewall-cmd --permanent --add-port=8787/udp
firewall-cmd --reload

重启Rstudio-server

$ rstudio-server 
Usage: rstudio-server {status|start|stop|restart|test-config|verify-installation|suspend-session|suspend-all|force-suspend-session|force-suspend-all|kill-session|kill-all|offline|online|active-sessions|version}

$ rstudio-server restart

通过浏览器登录Rstudio

不能使用管理员账户登录Rstudio,这是因为root账户读写权限太大,会把系统目录写的很乱,因此很多程序禁止使用管理员账户使用。


---------- END ----------

(可以添加作者微信,备注好单位+姓名)



您可能还会感兴趣的

手把手教你生信分析平台搭建专栏合集
生物信息重要资源站点合集
一个人全基因组完整数据分析脚本
一个细菌基因组完整分析脚本
生物信息常用30个Linux命令(三)
基因学苑文章列表(201810)
如何在Linux下优雅的装X
利用R实现vlookup
生物学才是终极学科

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存