Install RStudio Server on centOS6.5

My system is 64-bit centOS 6.5. The 64-bit version then is 0.98.766 and the following error  appeared when installing RStudio Server preview version:

[root@supstat download]# rpm -ivh rstudio-server-0.98.766-x86_64.rpm error: Failed dependencies:
libcrypto.so.6()(64bit) is needed by rstudio-server-0.98.766-1.x86_64
libgfortran.so.1()(64bit) is needed by rstudio-server-0.98.766-1.x86_64
libssl.so.6()(64bit) is needed by rstudio-server-0.98.766-1.x86_64

Refer to an article on stackoverflow:

yum install libcrypto.so.6 -y
yum install libgfortran.so.1 -y
yum install libssl.so.6 -y
yum install openssl098e-0.9.8e -y
yum install gcc41-libgfortran-4.1.2 -y
yum install pango-1.28.1 -y

wget ftp://rpmfind.net/linux/centos/6.5/os/x86_64/Packages/compat-libgfortran-41-4.1.2-39.el6.x86_64.rpm
rpm -Uvh compat-libgfortran-41-4.1.2-39.el6.x86_64.rpm
rpm -Uvh --nodeps rstudio-server-0.98.766-x86_64.rpm

Completion of the above steps is still not enough. Running rstudio-server verify-installation still reports errors.

The problem lies in the lack of library files, but there is indeed a file as mentioned in the error report  under /usr/lib. Then let’s check the library files under / usr/lib64 :

[root@supstat lib64]# ll libcrypto*
lrwxrwxrwx 1 root root 19 Apr 9 12:15 libcrypto.so -> libcrypto.so.1.0.1e
lrwxrwxrwx 1 root root 19 Apr 9 12:15 libcrypto.so.10 -> libcrypto.so.1.0.1e
-rwxr-xr-x 1 root root 1950976 Apr 8 10:42 libcrypto.so.1.0.1e
[root@supstat lib64]# ll libssl*
-rwxr-xr-x. 1 root root 250168 Feb 11 21:01 libssl3.so
lrwxrwxrwx 1 root root 16 Apr 9 12:15 libssl.so -> libssl.so.1.0.1e
lrwxrwxrwx 1 root root 16 Apr 9 12:15 libssl.so.10 -> libssl.so.1.0.1e
-rwxr-xr-x 1 root root 441112 Apr 8 10:42 libssl.so.1.0.1e

We could find there is no libcrypto.so.6 and libssl.so.6.

Attempting  to create a soft link library files:

cd /usr/lib64
ln -s libssl.so.10 libssl.so.6
ln -s libcrypto.so.10 libcrypto.so.6

rstudio-server verify-installation  test passed.

Firewall settings

In the browser, when entering http:// <server IP>: 8787, you will find it impossible to get accessed.  This  is due to built-in firewall policy in centOS which have not added 8787 port.

Next, modify the firewall configuration file:

vi /etc/sysconfig/iptables

Add -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT after the following sentence:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8787 -j ACCEPT

So that you can access it!

rstudio-server-login

User Settings

Sometimes we want to restrict user access to Rstudio Server, then it is necessary to modify the configuration file /etc/rstudio/rserver.conf, and add the following sentence:
auth-required-user-group=rstudio_users
Then add users groups rstudio_users and user supstat in the command line:
groupadd rstudio_users
useradd supstat
usermod -a -G rstudio_users supstat

# user password setting
passwd supstat

# if you want to add sudo permission for some users ,please refer to
#http://www.getroad.cn/blog/?action=show&id=801

chown -R supstat:rstudio_users /home/supstat
Then we can use supstat account to login in the Rstudio Server :
rstudio-server

View the process:

[root@supstat R]#ps aux|grep rstudio-server 498 19292 0.1 0.3 212788 3980 ? Ssl 07:30 0:00 /usr/lib/rstudio-server/bin/rserver
supstat 19307 0.5 4.3 568932 43956 ? Sl 07:31 0:03 /usr/lib/rstudio-server/bin/rsession -u supstat
root 19414 0.0 0.0 103248 864 pts/0 R+ 07:43 0:00 grep rstudio-server

We can see there are two rstudio-server-related processes: one is rserver system, and the other is the user supstat ‘s  rsession.

System configuration and system management

For installing under ubuntu you can refer to Zhang Dan’s blog

This article is a SupStat original article and shall not be reproduced without permission. For reprint please email contact#supstat.com(# replaced by @)