Use the following steps to set up R for Ubuntu. For other versions of linux, follow the instructions here instead: http://docs.rstudio.com/ide/server-pro/index.html#installation
1. Configure CRAN Repository. Add the following entry to your /etc/apt/sources.list file, substituting the correct name for your Ubuntu version where this example uses 'xenial' (the name for 16.x):
deb https://cran.cnr.berkeley.edu/bin/linux/ubuntu xenial/
If you are not sure what name your Ubuntu version is using, you can find it in other lines of the sources.list file.
$ gksudo gedit /etc/apt/sources.list
$ chmod 777 /etc/apt/sources.list
2. Install latest version of R
apt-get update
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
sudo apt-get install r-base
3. Install Rlabkey and other R packages
$ sudo R
> install.packages("Rlabkey", lib="/usr/local/lib/R/site-library")
> q()
> install.packages("package", lib="/usr/local/lib/R/site-library", dependencies=TRUE)
> q()
> sudo apt-get install libssl-dev
> sudo apt-get install libcurl4-openssl-dev
1. Download and install RStudio Pro as instructed when you purchased it. For demo purposes, you can use the free 45 day trial license and download from the RStudio download page.
$ sudo apt-get install gdebi-core
wget https://download2.rstudio.org/rstudio-server-pro-1.1.447-amd64.deb
(nb: this URL may not be current. Check the RStudio download page for latest version)
gdebi rstudio-server-pro-1.1.447-amd64.deb (substitute current version)
2. Activation: (Optional)
$ sudo rstudio-server license-manager activate ACTIVATION_KEY
3. Verify RStudio Pro Installation
useradd -m -s /bin/bash username
passwd username
$ ifconfig
In the host machine’s browser, go to http://ubuntuVmIPAddress:8787, you should see the RStudio login page and being able to log in.
5. Create a Route 53 DNS name for the server. You will need this for the next steps.
1. You will need to create an SSL cert:
ssl-enabled=1
ssl-certificate=/etc/ssl/certs/cert.pem
ssl-certificate-key=/etc/ssl/private/key.pem
auth-proxy=1
auth-proxy-sign-in-url=https://YOUR_SERVER_NAME/rstudio-startPro.view?method=LAUNCH
3. rstudio-server restart 4. Follow the instructions here for downloading the cert: https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ 5. Upload the saved cert to the destination server 6. On the destination Labkey server (nb: this will require restarting the LabKey instance):
8. (Optional) Custom security token
$sudo sh -c "echo 'X-LabKey-RStudio-Header' > /etc/rstudio/secure-proxy-user-header"
$sudo chmod 0600 /etc/rstudio/secure-proxy-user-header
LabKey users are mapped to RStudio users by removing the configured "email suffix". For example: LabKey user XYZ@email.com is mapped to RStudio user name XYZ
RStudio Pro uses Linux’s PAM authentication so any users accounts configured for Linux will be able to access RStudio Pro. Users can be added for RStudio by the adduser Linux command.
The following commands add a user “rstudio1” to Linux (and hence RStudio pro).
$ sudo useradd -m -d /home/rstudio1 rstudio1
$ sudo passwd rstudio1
Verify access to RStudio Pro for the newly added user:
Go to ip:8787, enter user and pw for the newly created user, verify the user can be logged in to RStudio successfully.
Troubleshoot for permission denied error on login:
$ sudo pamtester --verbose rstudio <username> authenticate acct_mgmt
ad_gpo_map_service = +rstudio
After making any change to the RStudio Pro config, always run the following for the change to take effect:
$sudo rstudio-server restart