6、shiny-server 配置
相关网址:http://rstudio.github.io/shiny-server/latest/
1) 配置文件路径(默认)
/etc/shiny-server/shiny-server.conf
2)配置内容
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# Define a server that listens on port 3838
server {
listen 8080;
# Define a location at the base URL
location / {
# Host the directory of Shiny Apps stored in this directory
site_dir /export/shiny-server/data;
# 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;
}
}
3)应用程序位置
Shiny Server默认会在/srv/shiny-server/目录查找你的Apps程序
可以把你开发的apps拷贝这个目录下:
sudo cp -R ~/MY-APP /srv/shiny-server/
如把Shiny自带的示例复制到这个目录下
--使用下面的命令查看library包的位置
# R -e ".libPaths()" --quiet
> .libPaths()
[1] "/usr/lib64/R/library" "/usr/share/R/library"
>