我们已经在linux ubuntu上构建了闪亮的服务器,我检查了状态和shiny-server.conf,两者似乎没问题,但是无法运行应用程序,请看如下: 1.闪亮的服务器状态:
root@ubuntu:~# sudo status shiny-server
shiny-server start/running, process 43150
server.conf
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# 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;
}
}
但是,当我将server.R
和UI.R
文件放在srv/shiny-server
下,然后运行该网址时,它是徒劳的并显示“未找到”。
http://<my_server>:3838/<app_name>
答案 0 :(得分:1)
下面的代码显示了创建的allappfolders,您可以在其下创建app1,app2..etc等各种应用。
下面将显示
下的所有应用http://<my_server>:3838/allappfolders
app1下方将加载ui.R和server.R
http://<my_server>:3838/allappfolders/app1
完整的conf。代码如下:
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# Define a server that listens on port 3838
server {
listen 3838;
location /users {
run_as :HOME_USER:;
user_dirs;
}
# Define a location at the base URL
location /allappfolders {
run_as shiny;
# Host the directory of Shiny Apps stored in this directory
site_dir /opt/shiny-server/allappfolders;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server/allappfolders;
# 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;
};
# Define a location at the base URL
location /app1 {
# Host the directory of Shiny Apps stored in this directory
app_dir /opt/shiny-server/allappfolders/app1;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server/app1;
# 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 off;
};
# Define a location at the base URL
location /app2 {
# Host the directory of Shiny Apps stored in this directory
app_dir /opt/shiny-server/allappfolders/app2;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server/app2;
# 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 off;
};
}
答案 1 :(得分:0)
3838端口IPTABLES问题:我在新的LINUX CENTOS系统上安装了SHiny Server。 一切都很好,但示例应用程序没有加载。 幸运的是,我的同事是一个LINUX NERD并快速检查端口IPTABLE条目。 他把它设置为OFF和EUREKA!我的示例应用程序启动并运行。 当系统连接到互联网时,只需安装rmarkdown软件包。