目录,代理和位置 – 如何在一个Apacheconfiguration中共存?

主要是通过试验和错误,我已经创build了下面的Apacheconfiguration文件。

它旨在允许通过WSGI的localhost:8002上的服务器和trac服务器共享LDAP服务器,并且看起来在同一个域/端口上。

规则是孤立的,但并不平行。

特别是,如果ProxyPass / ProxyPassReverse行被注释掉,trac WSGI将只能正确服务。 如果没有这个redirect,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> 

加:

 ProxyPass /trac ! 

在ProxyPass for'/'之前。

看到:

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

你也错过了一个WSGIProcessGroup指令。 该Trac实例不会在您创build的守护进程模式进程中运行。 看到:

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