【发布时间】:2015-10-26 22:57:28
【问题描述】:
我在安装了 Apache 2.4 的 Amazon EC2 (Ubuntu) 实例上运行闪亮的服务器。我想创建用户身份验证,所以我设置了 shiny-server 以仅收听 localhost。 闪亮的服务器配置如下所示:
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# Define a server that listens on port 3838
server {
listen 3838 localhost;
# 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;
}
}
我在/etc/apache2/apache2.conf 文件的末尾添加了以下几行
<VirtualHost *:80>
Redirect /TestEC2 /TestEC2/
ProxyPass /TestEC2/ http://localhost:3838/TestEC2/
ProxyPassReverse /TestEC2/ http://localhost:3838/TestEC2/
RedirectMatch permanent ^/TestEC2$ /TestEC2/
<Location /TestEC2>
AuthType Basic
AuthName "Enter your login name and password"
AuthUserFile /home/ubuntu/users
Require valid-user
</Location>
</VirtualHost>
在闪亮服务器配置中添加 localhost 之前直接通过端口 3838 评估应用程序工作正常。重新启动 Apache 和 Shiny 服务器也没有给出错误/警告。在评估端口 80 时,我还可以看到我的默认起始页面。我在这里做错了什么?
【问题讨论】:
标签: apache amazon-ec2 shiny-server