Rstudio-server deployment
After installing the two server with super user previledges, we can’t directly run the servers because the path to R has not been set.
The configuration file of rstudio-server lies at /etc/rstudio/rserver.conf
We shall append the following line:
rsession-which-r=/home/csj/anaconda3/envs/r411py37/bin/R
More options, such as port, external lib paths, could also be set in the rserver.conf file (see details at https://support.rstudio.com/hc/en-us/articles/200552316-Configuring-RStudio-Workbench-RStudio-Server)
Run the following command to verify if rstudio-server was configured successfully.
sudo rstudio-server verify-installation
we can manage the rstudio-server with the following commands
sudo rstudio-server status
sudo rstudio-server start
sudo rstudio-server stop
sudo rstudio-server restart
The default port of rstudio-server is 8787.
Shiny-server deployment
run the following code first before starting the server
export R=/home/csj/anaconda3/envs/r411py37/bin
the path to R shall be configured at /etc/shiny-server/shiny-server.conf
we can change the configurations here
# Define a server that listens on port 3838
server {
listen 3838;
# Define a location at the base URL
location / {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}
start the server with
sudo systemctl start shiny-server
No comments
Comments feed for this article
Trackback link: http://sjchen.top/wordpress/wp-trackback.php?p=189