Skip to content

Instantly share code, notes, and snippets.

@kellobri
Last active October 12, 2018 19:48
Show Gist options
  • Save kellobri/128796fe0a6b0998edde4999294df976 to your computer and use it in GitHub Desktop.
Save kellobri/128796fe0a6b0998edde4999294df976 to your computer and use it in GitHub Desktop.
Basic Install & Configure RStudio Connect on Amazon Linux 2

Basic Install & Configure RStudio Connect on Amazon Linux 2

yum update -y
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Build R From Source | Ref: 2.1.2

yum-builddep R -y
cd opt
wget https://cran.r-project.org/src/base/R-3/R-3.4.3.tar.gz
tar -xzvf R-3.4.3.tar.gz
cd R-3.4.3

./configure \
  --prefix=/opt/R/$(cat VERSION) \
  --enable-memory-profiling \
  --enable-R-shlib \
  --with-blas \
  --with-lapack

make
make install

Test R Installation: /opt/R/3.4.3/bin/R --version

Install RStudio Connect | Ref: 2.1.4

  1. Retrieve download URL
  2. Get and Install RSC
  3. Check and Install recommended system dependencies
cd opt
wget https://download-url/rstudio-connect-1.6.8.2-12.x86_64.rpm
yum install -y --nogpgcheck rstudio-connect-1.6.8.2-12.x86_64.rpm
yum install -y gcc gcc-c++ libcurl-devel libxml2-devel java-1.7.0-openjdk-devel openssl-devel

Initial Configuration

Show: Access Connect via Browser

  • Specify the public URL of the server
  • Configure authentication
  • Validate that email can be sent

Edit the config: vi /etc/rstudio-connect/rstudio-connect.gcfg

  1. Set SenderEmail
  2. Set Address http://ec2-54-226-33-89.compute-1.amazonaws.com:3939/connect/
  3. Turn off HTTP Connection Warning: Add NoWarning = true after 'Listen = :3939'
  4. Restart: systemctl restart rstudio-connect
  5. Check status: systemctl status rstudio-connect

Refresh: Access Connect via Browser

Configure Authentication

Password Auth (Default - Backed by the RStudio Connect Database): Password authentication may be appropriate in small organizations without centralized IT systems.

  • Validate that email can be sent

The users can be created by an admin or they can register themselves through the RStudio Connect dashboard. The Connect Server API can also be used to create users ahead of the first login.

The users created by an admin or via Connect Server API without a password will receive an email confirmation which should be used to configure a password.

Existing user accounts can reset their passwords through the Connect login page.

If you wish to disable self-registration, use the configuration setting Password.SelfRegistration = false

New users will default to the "Viewer" Role, meaning that they won't be able to publish data assets to our Connect Server and you'll need to go in and change those roles to promote someone to be a publisher if they need to be. For evaluation servers like this one, I like to start with setting the default user role to be publisher, so that everyone I invite can try it out. Authorization.DefaultUserRole = publisher

Create new authentication heading:

[Authorization]
DefaultUserRole = publisher

Create New Users

  • Now Users can sign up
  • Or I (the admin) can create them from the RSC UI People > Add User

Check the Evaluation License Status

/opt/rstudio-connect/bin/license-manager status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment