安装服务器R和Rstudio(网页访问)

1. 安装R

默认的CentOS源中是没有R软件的,需要安装epel源,我们之前已经安装了,R软件在里面的名字为R.x86_64。

$yum install -y R.x86_64
## $ yum list |grep ^R
R.x86_64                                    3.6.0-1.el7                @epel
R-core.x86_64                               3.6.0-1.el7                @epel
R-core-devel.x86_64                         3.6.0-1.el7                @epel
R-devel.x86_64                              3.6.0-1.el7                @epel
R-java.x86_64                               3.6.0-1.el7                @epel
R-java-devel.x86_64                         3.6.0-1.el7                @epel
R-RInside.x86_64                            0.2.16-1.el7               epel
R-RInside-devel.x86_64                      0.2.16-1.el7               epel
R-RInside-examples.x86_64                   0.2.16-1.el7               epel
R-RUnit.noarch                              0.4.32-1.el7               epel
R-Rcpp.x86_64                               1.0.5-1.el7                epel
R-Rcpp-devel.x86_64                         1.0.5-1.el7                epel
R-Rcpp-examples.x86_64                      1.0.5-1.el7                epel
R-highlight.x86_64                          0.5.0-1.el7                epel
R-inline.noarch                             0.3.16-1.el7               epel
R-littler.x86_64                            0.3.12-1.el7               epel
R-littler-examples.x86_64                   0.3.12-1.el7               epel
R-qtl.x86_64                                1.46.2-1.el7               epel
R-rlecuyer.x86_64                           0.3.4-1.el7                epel
R2spec.noarch                               4.2.1-1.el7                epel
RBTools.noarch                              1.0.3-1.el7                epel
RabbIT.noarch                               4.1-13.el7                 epel
RackTables.noarch                           0.20.14-1.el7              epel
RdRand.x86_64                               2.1.2-2.el7                epel
RdRand-devel.x86_64                         2.1.2-2.el7                epel
ReviewBoard.noarch                          2.5.17-1.el7               epel

2.安装Rstudio-server(安装这个可以用网页访问)

下载最新版Rstudio-server
https://www.rstudio.com/products/rstudio/download-server/

wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.2.1335-x86_64.rpm
yum install -y rstudio-server-rhel-1.2.1335-x86_64.rpm

3.开启8787端口

+++记得要在root下+++

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

这样就完成了R与Rstudio-server的安装,通过IP地址加端口好就可以访问了。例如8.8.8.8:8787


image.png

你可能感兴趣的:(安装服务器R和Rstudio(网页访问))