Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set-up Trac to authorise users via the LDAP plugin on a Debian (Lenny) server.

LDAP appears to be working correctly, I can query successfully via:

ldapsearch -vLx -h -b "dc=example, dc=com" "(sn=mysurname)"

And if i purposely break my Apache LDAP address settings I can see errors in /var/log/apache2/error.log

2010-08-27 17:19:38,909 Trac[api] WARNING: LDAP error: No such object (dc=examplefoo,dc=com)

When I visit and click the login button the authentication window pops up (confirming again that LDAP is kicking in), however, when I enter a correct username/password I just get a Trac web page with:

Trac Error
Authentication information not available. Please refer to the installation documentation.

TracGuide — The Trac User and Administration Guide

The logs are equally unhelpful (ignore the svn error, I'm aware of that):

2010-09-01 14:25:30,553 Trac[api] DEBUG: NEEDS UP?: sys:False, rep:False, stats:False, fields:False, man:False
2010-09-01 14:25:30,577 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
2010-09-01 14:25:30,577 Trac[main] DEBUG: Dispatching <Request "GET u'/login'">
2010-09-01 14:25:30,583 Trac[svn_fs] INFO: Failed to load Subversion bindings
Traceback (most recent call last):
  File "/home/web/example/buildout-cache/eggs/Trac-0.11-py2.6.egg/trac/versioncontrol/", line 251, in __init__
  File "/home/web/example/buildout-cache/eggs/Trac-0.11-py2.6.egg/trac/versioncontrol/", line 69, in _import_svn
    from svn import fs, repos, core, delta
ImportError: No module named svn
2010-09-01 14:25:30,584 Trac[chrome] DEBUG: Prepare chrome data for request
2010-09-01 14:25:30,586 Trac[api] DEBUG: action controllers for ticket workflow: ['ConfigurableTicketWorkflow']
2010-09-01 14:25:30,597 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_CREATE on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing TRAC_ADMIN on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_GRANT on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_REVOKE on None
2010-09-01 14:25:30,599 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_ADMIN on None
2010-09-01 14:25:30,601 Trac[main] WARNING: 500 Trac Error (Authentication information not available. Please refer to the <a href="/trac/wiki/TracInstall#ConfiguringAuthentication" title="Configuring Authentication">installation documentation</a>.)
2010-09-01 14:25:30,621 Trac[perm] DEBUG: No policy allowed anonymous performing EMAIL_VIEW on None
2010-09-01 14:25:30,621 Trac[session] DEBUG: Retrieving session for ID '20e2cfb643bff0f9121fe615'
2010-09-01 14:25:30,641 Trac[tande_filters] DEBUG: self.billing_reports= set([9, 10, 11, 12, 13, 14, 15, 16, 17])
2010-09-01 14:25:30,642 Trac[ticket_webui] DEBUG: TicketWebUiAddon executing
2010-09-01 14:25:30,774 Trac[main] DEBUG: 124 unreachable objects found.

My apache set-up is as follows.


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

    ProxyPreserveHost On
    RewriteEngine On
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule ^/(.*)$1 [P]

<Location /trac/login>
   AuthType Basic
   AuthName "Trac"
   AuthBasicProvider ldap
   Order Allow,Deny
   Allow from All
   AuthLDAPURL "ldap://,dc=com?uid"
   #should be on if using groups
   AuthzLDAPAuthoritative off
   Require valid-user
   #Require ldap-group cn=tracusers,dc=example,dc=com

The server has a number of other in-development services running, hence the odd port number.

My trac.ini is a fresh install, with the following changes:

basedn = dc=example,dc=com
bind_passwd = foo
bind_user = cn=admin,dc=example,dc=com
enable = true
group_rdn = ou=people
host =
port = 389
use_tls = false
user_rdn = ou=users

ldapplugin.* = enabled

For testing I just start the Trac server with:

bin/tracd --port 8202 parts/trac

Where am I going wrong? It feels as if the Apache config is as fault, as LDAP does seem to be working.

Is that the correct command to be starting the server with (htpasswd for example has it's own options)?

In the long run what's the best way to run the server? WSGI?

share|improve this question
Did you fixed it ? I'm interested by the solution of this problem... – Kartoch Nov 10 '11 at 14:07

If you need to test your "Apache+LDAP+Trac" binding, you don't need to run standalone bin/tracd.

First try to use Apache LDAP authentification with Trac without LdapPlugin(it just adds ability to manage trac permissions for LDAP groups). You should configure authentifacation on /trac/login location, and Trac will automatically get authentificated user name. Look here: TracModWSGI - ConfiguringAuthentication This works fine in my setup(Debian Squeeze, Trac 0.12). So just remove all your modifications from from trac.ini.

When you will get working authentification, you may start configuring LdapPlugin.

WSGI is IMHO best way to run python application on Apache, it's fast and simple.

share|improve this answer

Your Answer


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.