我有一個最初設置用於intranet訪問的apache服務器,所以我不必擔心太多關於鎖定的問題。mod_rewrite之前的Apache 2.x auth
後來,我需要打開它的互聯網,所以我把LDAP身份驗證指令在httpd.conf的部分,像這樣:
Order allow,deny
AuthBasicProvider ldap
AuthType Basic
AuthzLDAPAuthoritative on
AuthName "MyCompany Intranet"
AuthLDAPURL "ldap://myldapserver.mydomain.com:389/CN=Users,DC=mydomain,DC=com?sAMAccountName?sub?(memberOf=CN=Everyone at MyCompany,OU=MyCompany Groups,DC=mydomain,DC=com)" NONE
AuthLDAPBindDN "CN=Administrator,CN=Users,DC=mydomain,DC=com"
AuthLDAPBindPassword "MyPassword"
Require valid-user
#Allow from all
Allow from 192.168.1
Allow from 10.254.0
Satisfy any
基本上,這使得它使本地用戶可能無法進入密碼,外部用戶必須通過ADS域進行身份驗證才能進入。
現在事情變得更加複雜。
我有一個應用程序,我通過將一個cgi變量添加到URL的末尾來區分用戶,所以我在我的Web目錄(/ var/www/html)的根目錄中設置了一個.htaccess文件作爲如下:
RewriteEngine on
RewriteBase/
RewriteRule ^foo/(.*)$ some/really/long/url/$1?tenant_filter=2 [L]
RewriteRule ^bar/(.*)$ some/really/long/url/$1?tenant_filter=1 [L]
這工作真的很棒。客戶端輸入http://myserver.mydomain.com/foo/file.html,並且URL神奇地將它們指向http://myserver.mydomain.com/some/really/long/url/file.html?tenant_filter=2而他們看到的只是http://myserver.mydomain.com/foo/file.html。
這裏是哪裏出了問題的用武之地。
我想定義爲/ foo和/條虛擬目錄獨立認證參數。無論我嘗試什麼,身份驗證都會被上面的http.conf中的ldap設置覆蓋。我做錯了什麼,我能做些什麼來實現我的目標?它甚至有可能嗎?
在添加這個配置文件的上下文中? – Ass3mbler 2011-01-31 20:23:34