문제

지침이 있습니다

<VirtualHost *>
    <Location />
        AuthType Digest
        AuthName "global"
        AuthDigestDomain /
        AuthUserFile /root/apache_users
        <Limit GET>
            Require valid-user
        </Limit>
    </Location>
    WSGIScriptAlias / /some/script.wsgi
    WSGIDaemonProcess mywsgi user=someuser group=somegroup processes=2 threads=25
    WSGIProcessGroup mywsgi
    ServerName some.example.org
</VirtualHost>

/some/script.wsgi에서 알고 싶습니다

def application(environ, start_response):
    start_response('200 OK', [
        ('Content-Type', 'text/plain'),
    ])
    return ['Hello']

로그인 한 사용자

어떻게해야하나요?

도움이 되었습니까?

해결책

추가하다 WSGIPassAuthorization On:

<VirtualHost *>
    <Location />
        AuthType Digest
        AuthName "global"
        AuthDigestDomain /
        AuthUserFile /root/apache_users
        <Limit GET>
            Require valid-user
        </Limit>
    </Location>
    WSGIPassAuthorization On
    WSGIScriptAlias / /some/script.wsgi
    WSGIDaemonProcess mywsgi user=someuser group=somegroup processes=2 threads=25
    WSGIProcessGroup mywsgi
    ServerName some.example.org
</VirtualHost>

그냥 읽으십시오 environ['REMOTE_USER']:

def application(environ, start_response):
    start_response('200 OK', [
        ('Content-Type', 'text/plain'),
    ])
    return ['Hello %s' % environ['REMOTE_USER']]

자세한 정보 mod_wsgi 문서.

다른 팁

Apache/mod_wsgi 및 액세스, 인증 및 인증 메커니즘에 대한 추가 정보는 다음과 같습니다.

http://code.google.com/p/modwsgi/wiki/accesscontrolmechenisms

정보는 기본적으로 전달되지 않기 때문에 비밀번호 정보가 응용 프로그램에 유출 될 수 있으므로 정보를 얻을 수 없기 때문에 정보는 기본적으로 전달되지 않습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top