Configuring uWSGI with LDAP

uWSGI can be configured using LDAP. LDAP is a flexible way to centralizeconfiguration of large clusters of uWSGI servers.

Note

LDAP support must be enabled while building uWSGI. Thelibldap library is required.

Importing the uWSGIConfig schema

Running uWSGI with the –ldap-schema or –ldap-schema-ldif parameter willmake it output a standard LDAP schema (or an LDIF file) that you can importinto your server.

An example LDIF dump

This is an LDIF dump of an OpenLDAP server with a uWSGIConfig entry, runninga Trac instance.

  1. dn: dc=projects,dc=unbit,dc=it
  2. objectclass: uWSGIConfig
  3. objectclass: domain
  4. dc: projects
  5. uWSGIsocket: /var/run/uwsgi/projects.unbit.it.sock
  6. uWSGIhome: /accounts/unbit/tracvenv
  7. uWSGImodule: trac.web.main:dispatch_request
  8. uWSGImaster: TRUE
  9. uWSGIprocesses: 4
  10. uWSGIenv: TRAC_ENV=/accounts/unbit/trac/uwsgi

Usage

You only need to pass a valid LDAP url to the –ldap option. Only the firstentry returned will be used as configuration.

If you want a filter with sub scope (this will return the first record underthe tree dc=projects,dc=unbit,dc=it with ou=Unbit):