Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails ruby rails apache2在httpd.conf中使用基本LDAP身份验证_Ruby On Rails_Apache_Authentication_Ldap_Passenger - Fatal编程技术网

Ruby on rails ruby rails apache2在httpd.conf中使用基本LDAP身份验证

Ruby on rails ruby rails apache2在httpd.conf中使用基本LDAP身份验证,ruby-on-rails,apache,authentication,ldap,passenger,Ruby On Rails,Apache,Authentication,Ldap,Passenger,我有一个网站,我想强制用户通过LDAP登录,然后他们才能看到网站的首页。这适用于一般网页,但不适用于在apache2上运行passenger的rails站点。我看过一些参考资料,这是因为乘客不尊重Directory命令(或者在到达该指令之前拾取)。有没有办法做到这一点,或者我需要在网站上添加Desive <VirtualHost *:80> ServerName test.example.com DocumentRoot "/www/software/rails_si

我有一个网站,我想强制用户通过LDAP登录,然后他们才能看到网站的首页。这适用于一般网页,但不适用于在apache2上运行passenger的rails站点。我看过一些参考资料,这是因为乘客不尊重Directory命令(或者在到达该指令之前拾取)。有没有办法做到这一点,或者我需要在网站上添加Desive

<VirtualHost *:80>
    ServerName test.example.com
    DocumentRoot "/www/software/rails_site/current/public"
    ErrorLog "/www/logs/software/rails_site/error_log"
    CustomLog "/www/logs/software/rails_site/access_log" common
    DirectoryIndex index.html
    RailsEnv production

    <Directory "/www/software/rails_site/current/public">
      AuthType Basic
      AuthName "Secure portal"
      AuthBasicProvider ldap
      AuthzLDAPAuthoritative on
      AuthLDAPURL "info"
      AuthLDAPBindPassword "pass"
      require ldap-user usernames
      Order deny,allow
      Satisfy Any
   </Directory>
</VirtualHost>

ServerName test.example.com
DocumentRoot“/www/software/rails\u site/current/public”
ErrorLog“/www/logs/software/rails\u site/error\u log”
自定义日志“/www/logs/software/rails\u site/access\u log”通用
DirectoryIndex.html
RailsEnv生产
AuthType Basic
AuthName“安全门户”
AuthBasicProvider ldap
奥兹尔达蓬
AuthLDAPURL“信息”
AuthLDAPBindPassword“通过”
需要ldap用户名
命令拒绝,允许
满足任何

在首次尝试加载站点时,上述操作不会阻止站点加载或进行任何质询。

请尝试将身份验证指令放置在一个位置而不是目录中,以便它们首先由传入的URI触发。显然,乘客有一个与目录指令相关的操作顺序

这篇旧帖子证实了你正在尝试做的(至少过去是)是可能的:


我使用Desive\u ldap\u authenticatable gem取得了很大成功。它不需要在apache2配置文件中进行任何修改。感谢您提供的信息。使用passenger 3.0.9和httpd 2.2.17使用Location指令似乎不起作用。