Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Mostly through trail and error I have created the Apache configuration file below.

It aims to allow a server on localhost:8002 and a trac wsgi server to share an ldap server and appear on the same domain/port.

The rules work in isolation, but not together. In particular, trac wsgi will only serve correctly if ProxyPass/ProxyPassReverse lines are commented out. Without that redirect the server at localhost:8002 obviously isn't mapped to the outgoing 8022 port.

I assume the mix of Directory, Proxy and Location rules is the route of my problem - or perhaps the order of them?

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>
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Add:

ProxyPass /trac !

before ProxyPass for '/'.

See:

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

You are also missing a WSGIProcessGroup directive. That Trac instance isn't going to run in the daemon mode process you created. See:

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

share|improve this answer
    
Great answer, useful added detail - fixed my problem. Good stuff Graham, thanks. –  Jon Hadley Sep 9 '10 at 9:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.