【问题标题】:Apache redirect to shiny server return 404Apache 重定向到闪亮的服务器返回 404
【发布时间】: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


    【解决方案1】:

    环顾了一段时间后,我找到了解决方案。我输入apache2.conf 的信息需要输入sites-enables/000-default.conf。然后重启apache2。还要确保模块 proxyproxy_httpproxy_connect 已加载(例如 a2enmod proxy

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-01
      • 2021-04-29
      • 1970-01-01
      • 2016-06-05
      • 2021-11-07
      • 2021-03-10
      • 1970-01-01
      • 2015-05-04
      相关资源
      最近更新 更多