디렉토리, 프록시 및 위치 - 하나의 Apache 구성에 공존하는 방법은 무엇입니까?

디렉토리, 프록시 및 위치 - 하나의 Apache 구성에 공존하는 방법은 무엇입니까?

대부분 시행착오를 거쳐 아래 Apache 구성 파일을 만들었습니다.

이는 localhost:8002의 서버와 WSGI를 통한 trac 서버가 LDAP 서버를 공유하고 동일한 도메인/포트에 있는 것처럼 보이도록 하는 것을 목표로 합니다.

규칙은 개별적으로 작동하지만 동시에 작동하지는 않습니다.

특히, trac WSGI는 ProxyPass/ ProxyPassReverse행이 주석 처리된 경우에만 올바르게 제공됩니다. 그렇지 않으면 localhost:8002의 서버를 리디렉션하지 않으면 분명히 나가는 8022 포트에 매핑되지 않습니다.

나는 디렉토리, 프록시 및 위치 규칙의 혼합이 내 문제의 경로라고 가정합니다. 아니면 순서일까요?

WSGIDaemonProcess trac stack-size=524288 python-path=/usr/lib/python2.5/site-packages
WSGIScriptAlias /trac /home/web/foo/parts/trac/tracwsgi/cgi-bin/trac.wsgi

<VirtualHost foo.bar.com:8022>
    ServerName foo.bar.com
    ServerAlias foo.bar.com

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPreserveHost On
    ProxyPass / http://localhost:8002/VirtualHostBase/http/foo.bar.com:8022/foo/VirtualHostRoot/
    ProxyPassReverse / http://localhost:8002/VirtualHostBase/http/foo.bar.com:8022/foo/VirtualHostRoot/

    <Directory "/home/web/foo/parts/trac/tracwsgi/cgi-bin">
        WSGIApplicationGroup %{GLOBAL}
        Options +Indexes FollowSymLinks
        AllowOverride None
        Allow from all
        Order allow,deny
    </Directory>

    <Location "/trac">
        AuthBasicProvider ldap
        AuthType Basic
        AuthzLDAPAuthoritative off
        AuthName "Login"
        AuthLDAPURL "ldap://127.0.0.1:389/dc=foo-bar,dc=org?uid"
        AuthLDAPBindDN "cn=admin, dc=foo-bar, dc=org"
        AuthLDAPBindPassword secret
        require valid-user
    </Location>

</VirtualHost>

답변1

추가하다:

ProxyPass /trac !

'/'에 대한 ProxyPass 앞에.

보다:

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

WSGIProcessGroup 지시문도 누락되었습니다. 해당 Trac 인스턴스는 생성한 데몬 모드 프로세스에서 실행되지 않습니다. 보다:

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

관련 정보