
Größtenteils durch Ausprobieren habe ich die folgende Apache-Konfigurationsdatei erstellt.
Ziel ist es, einem Server auf localhost:8002 und einem Trac-Server über WSGI zu ermöglichen, einen LDAP-Server gemeinsam zu nutzen und den Anschein zu erwecken, sich in derselben Domäne/am selben Port zu befinden.
Die Regeln funktionieren isoliert, aber nicht parallel.
Insbesondere funktioniert Trac WSGI nur dann korrekt, wenn ProxyPass
/ ProxyPassReverse
Zeilen auskommentiert sind. Ohne diese Umleitung ist der Server unter localhost:8002 offensichtlich nicht dem ausgehenden Port 8022 zugeordnet.
Ich gehe davon aus, dass die Mischung aus Verzeichnis-, Proxy- und Standortregeln die Ursache meines Problems ist – oder vielleicht deren Reihenfolge?
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>
Antwort1
Hinzufügen:
ProxyPass /trac !
vor ProxyPass für '/'.
Sehen:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass
Außerdem fehlt eine WSGIProcessGroup-Direktive. Diese Trac-Instanz wird nicht im Daemon-Modus-Prozess ausgeführt, den Sie erstellt haben. Siehe: