• Welcome to LiuJason's Blog!

CentOS7下一键安装指定R版本的Rstudio-Server|4.0.0|3.6.3

Linux笔记 Jason 5 years ago (2020-05-29) 1053 Views 0 Comments
文章目录[隐藏]

一键代码

不多说了直接上,以root用户权限执行以下代码:

wget https://git.io/JfK3B -v -O install.sh && ./install.sh; rm -rf install.sh

小广告

非常棒的Rstudio云服务器,价格也超便宜的:
https://my.cloudraft.cn/server/buy.html
支持一键安装Rstudio各种版本,最高64核256G内存5TB固态硬盘!价格是阿里云的一半不到!复旦硕博士开的创业公司,专营科研服务的,有科研服务发票+合同!
加本博主QQ840910289咨询有大折扣优惠!

源码

脚本地址:https://github.com/LiuZixia/R-tools/blob/master/Rstudio-Server/Install-CentOS7.sh

#!/bin/bash
echo -e "Install Rstudio-Server (v1.3.959) with custom version.\nBy LiuZixia@GitHub \nUrl: https://github.com/LiuZixia/R-tools"
read -p "Enter R version [3.6.3]: " R_VERSION
R_VERSION=${R_VERSION:-3.6.3}
read -p "Enter Rstudio-Server Web Interface port [80]: " RSTUDIO_PORT
RSTUDIO_PORT=${RSTUDIO_PORT:-80}
yum install sudo -y
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
sudo subscription-manager repos --enable "rhel-*-optional-rpms" -y
curl -O https://cdn.rstudio.com/r/centos-7/pkgs/R-${R_VERSION}-1-1.x86_64.rpm
sudo yum install R-${R_VERSION}-1-1.x86_64.rpm -y
sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R
sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript
pwhash=$(sudo getent shadow root | cut -d: -f2)
sudo useradd -p "$pwhash" rstudio -d /data
chown -R rstudio /data
wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.3.959-x86_64.rpm
sudo yum install rstudio-server-rhel-1.3.959-x86_64.rpm -y
echo "www-port=${RSTUDIO_PORT}" >> /etc/rstudio/rserver.conf
echo "www-address=0.0.0.0" >> /etc/rstudio/rserver.conf
sudo rstudio-server restart
firewall-cmd --zone=public --add-port=${RSTUDIO_PORT}/tcp --permanent
firewall-cmd --reload
© 2020 GitHub, Inc.

This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/797.html
Like (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址