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.
- dn: dc=projects,dc=unbit,dc=it
- objectclass: uWSGIConfig
- objectclass: domain
- dc: projects
- uWSGIsocket: /var/run/uwsgi/projects.unbit.it.sock
- uWSGIhome: /accounts/unbit/tracvenv
- uWSGImodule: trac.web.main:dispatch_request
- uWSGImaster: TRUE
- uWSGIprocesses: 4
- 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.
uwsgi –ldap ldap://ldap.unbit.it/dc=projects,dc=unbit,dc=it
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):
uwsgi –ldap ldap://ldap.unbit.it/dc=projects,dc=unbit,dc=it?sub?ou=Unbit