2010-01-14 53 views
1

我已經在另一個服務器上的工作WSGI認證,但是第二服務器時不重新加載與所述消息以接受相同的結構和錯誤:未知Authn提供商:WSGI ...失敗!

Syntax error on line 12 of /etc/apache2/sites-enabled/mydomain.com 
Unknown Authn provider: wsgi 
    ... fail 

這裏是配置文件的相關部分(線12 WSGIAuthUserScript ...)

<Location /adirectory/> 
    AuthType Basic 
    AuthName "Answer me these questions two" 
    AuthBasicProvider wsgi 
    WSGIAuthUserScript /home/auser/domains/mydomain.com/apache/auth_test.wsgi 
    Require valid-user 
</location> 

WSGIPassAuthorization On 

而且auth_test.wsgi文件:

def check_password(environ, user, password): 

    if user == 'someusername': 
     if password == 'asecretpassword': 
      return True 
     return False 

    return None 

MOD-wsgi.conf和MOD-WSGI .load都啓用。當然,必須有/東西/不同,但我很茫然。

+0

如果使用WSGIAuthUserScript,則不需要WSGIPassAuthorization,因爲您不需要將登錄憑證發送到主WSGI應用程序(如果存在),因爲它已在調用之前處理。 – 2010-01-14 23:56:53

回答

1

它原來是一個WSGI版本差異。

+0

你能否詳細說明。你的意思是你仍在使用mod_wsgi的1.X,它是因爲只有mod_wsgi的2.0或更高版本支持WSGIAuthUserScript?即便如此,阿帕奇應該抱怨WSGIAuthUserScript不被支持的,除非解析的順序意味着AuthBasicProvider第一次給了,因爲沒有能找到下「WSGI」註冊的認證供應商的錯誤。 – 2010-01-15 00:01:50