【发布时间】:2010-01-14 16:39:03
【问题描述】:
我在另一台服务器上进行了 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 都已启用。当然一定有/something/不同,但我不知所措。
【问题讨论】:
-
如果使用 WSGIAuthUserScript 则不需要 WSGIPassAuthorization已经被调用了。
标签: python apache mod-wsgi wsgi