Skip to content

3 Installing R packages for rApache

Alex Pickering edited this page Jan 21, 2018 · 3 revisions

By default, R installs packages in the first value of .libPaths() and can find packages in all .libPaths().

Apache is run as user www-data and cannot find packages installed in a different, user-specific library. As such, its best to install packages for rApache in /usr/local/lib/R/site-library. To do so:

# need write permission for the desired directory
sudo R

# run this after starting R to install new packages for rApache
.libPaths('/usr/local/lib/R/site-library')

# used by handlr for defining resource limits for R endpoints
install.packages('sys', configure.vars = 'NO_APPARMOR=1')
q('no')

To install handlr:

# system dependencies
sudo apt install libssl-dev 
sudo apt install libcurl4-openssl-dev

sudo R
.libPaths('/usr/local/lib/R/site-library')

# for installing packages from github
install.packages('devtools')

# install handlr
devtools::install_github('alexvpickering/handlr')

q('no')

Clone this wiki locally