]> andersk Git - mod-vhost-ldap.git/blame - debian/README.Debian
upstream? :-)
[mod-vhost-ldap.git] / debian / README.Debian
CommitLineData
7efbad34
OS
1libapache2-mod-vhost-ldap and LDAP server support
2=================================================
3
686ce5d8
PW
4Your LDAP server needs to include module schema files,
5functionality. If you do not use OpenLDAP you are on your own to build a schema.
6for each kind of functionality (core vhost, auth-perdir, auth-perlocation,
7auth-perdirectory). Temporarily remove cgi-suexec support, it
8will be added again in the way which cooperates with new aliasing
48103d4a 9
686ce5d8 10 -- Piotr Wadas <pwadas@jewish.org.pl> Tue 18 Jul 2006 11:33:24 +0100
7efbad34
OS
11
12You should configure the LDAP server to maintain indices on apacheServerName,
13apacheServerAlias and anything you use in your additional search filter.
14
15 -- Ondřej Surý <ondrej@sury.org> Tue, 30 Aug 2005 15:25:32 +0200
16
6d3c529e
OS
17libapache2-mod-vhost-ldap, suexec and cgid
18==========================================
19
20libapache2-mod-vhost-ldap suexec support doesn't work with cgid (enabled
21as default in Debian). Cgid has special hacks for suexec module and any
22other module which set suexec uid and gid crashes mod_cgid. For more
23information see http://issues.apache.org/bugzilla/show_bug.cgi?id=36410
24
25You can use cgi module instead.
26
27 -- Ondřej Surý <ondrej@sury.org> Tue, 30 Aug 2005 09:24:21 +0200
28
48103d4a
PW
29
30Just run "make" to build the module and "make install" (as root) to install
31the module. This will use Apache's apxs to build/install from source.
32
33Have a look at vhost_ldap.conf to learn about configuration.
34
35Authentication and authorization works in the following way:
36
371. Vhost configuration is checked in ldap
38At this step all requested attributes such as ServerName, ServerAlias etc.
39including apacheExtConfig attributes, are taken. If not - vhost is returned
40OK and goes after further request processing.
41
422. If vhost has set
43apacheExtConfigHasRequireLine = TRUE, AND AT LEAST ONE apacheLocationOptionsDn
44is set pointing to apacheExtConfig object, vhost is marked to have auth/auth.
45
463. Then request URI is checked - starting from /, if for URI or any of
47URIs below apacheExtConfigObject with apacheExtUri set for uri, is found below
48base dn set with VhostLDAPWebLocationConfigBaseDn, processing to generate
49require lines. Note, that whatever apacheExtConfigObjectName You set
50for configuration, it will appear on authentication dialog box as You'd
51specify it with AuthName directive. AuthType (basic) is in code.
52
534. if apacheExtConfigRequireValidUser for matched extConfig object is
54set to TRUE, then "require valid-user" is generated.
55if apacheExtConfigRequireValidUser is set to FALSE, then
56there's another search performed, under webUsersbase, to find user names,
57for which apacheExtConfigUserServerName matches vhost original name.
58All usernames are appended for require line, which contains at least no-user
59"nobody",
60if no user objects are found. so after, we have
61require valid-user
62or
63require nobody username1 username2
64placed into apache config
65
665. authentication phase - user password is checked with LDAP. Note, that
67it's checked agains two conditions - with apr_validate_password, and with clear
68text. So, in userPassword field, You can put password taken from .htaccess file
69(or generated with htpasswd -n), or clear text, and it will be matched agains
70string comparison.
71
726. Then, authorization phase - if for current URI on previously generated
73require line, basic-auth username is found, then access is granted.
74
757. In log You shoud have information, whether authentication is successed or
76failed, and then information _ONLY_ if authorization denies access.
77(authorization access granted is not logged, don't ask why :)
78
79MORE EXPLANATION:
80object of one of apacheExt* classess, have some dn-syntax attributes, which
81should point like below:
82
83* one or more apacheLocationOptionsDn | for vhost,
84 pointing location config(s)
85
86* one or more apacheExtConfigUserDn | for location config,
87 pointing user object(s)
88
89However this is for use with some external management GUI to keep track of
90what's going on - search is made for location on vhost level, and search is
91made for users on location level, because apr doesn't have convenient routines,
92which allows getting object directly based on its DN. So final result
93must be FOUND, not GET, and is found based on another attribute value,
94eg. apacheExtConfigServerName for location config,
95and apacheExtConfigUserServerName This should be
96implemented with ldap.h, or routines for apr should be created.
97
98IMPORTANT NOTE 1:
99All searches for users, and location configurations, are made with
100apacheServerName attribute value of current vhost - no matter via which
101alias You're accessing server. So YOU DON'T NEED TO ADD EACH serverAlias
102to UserObject, or configObject - just add serverName.
103The concept is, that when You want to block some resource, eg. some
104directory with Your pictures, You want it blocked for all aliases on current
105server, no matter how it's access. If You share the same directory under
106another vhost, you need to add this vhost serverName to location
107extConfigServerName.
108
109IMPORTANT NOTE 2:
110Authentication and authorization with this module is dynamic, that's
111why advanced features like apache configstream are not used. Actually
112auth/authz information is build against each request, to make You able
113to manipulate access control information, without server restarting
114(even graceful). Actually making graceful, is no problem - the point is,
115that if You edit Your LDAP with some external tool,
116e.g. excellent phpldapadmin, You may not want this tool to execute or force
117(in any way) any kind of daemons restart. Another solution, is to put
118graceful into cron somewhere, however I guess dynamic access control
119is more ee.., well, its better solution :)
120
121IMPORTANT NOTE 3:
122If Your changes in LDAP seems to not working, check some cacheTTL and
123other directives with apache ldap_module, You've read this module manual,
124didn't You? :)
125
126
127TIPS and HINTS:
128Enjoying LDAP power - You can have multiple values for some attributes.
129actually no matters how many values You set for apacheLocationOptionsDn
130(must be at least one), because search is made with uri and serverName.
131
132However, You can set more than one serverName with location object,
133if You want the have the same URI blocked on more than one webserver,
134eg. if Your vhosts has standard location "/statistics", You can
135block them for all vhosts you want, no matter, whether real statistics
136dir exists in filesystem, or not (auth/authz is made before returning data).
137Anyway defining the same location for different vhosts as separated object
138should work, however they should have different naming attribute.
139If You set two objects, for the same uri and different naming attribute, and
140the same vhost servername value, probably the first one found will be used,
141I didn't check.
142extConfigObject may also apply to more than one URI - the same.
143You can also have the same user, valid for more than one vhost, exactly
144the same rules apply like above.
145One user can have more than one password.
146
147Actually defining separate objects, makes sens only if
148You want to be able to quickly enable/disable particular URI
149(or user, or config, etc. etc.), instead of removing it, probably
150based on some attribute value defined elsewhere, and applied to ldap filter
151in mod-ldap-vhost configuration.
152
153DEVELOPER's NOTE:
154The main trick is, that ap_requires is used to SET requirelines using generated
155apr_array_header_t, based on some information source, before it's later used
156in normal authz procedure, at appropriate authorization hook.
157
158TODOs (unsorted):
159* general code review (use of per-directory-config ?)
160* implement php_admin_flag and php_admin_value setting for vhosts with ldap
161* implement directory access control, similar to location
162* implement directory/location aliasing between vhosts, based on ldap
163* implement logging-related directives for ldap-based vhosts
164* implement require group
165* implement use of other authentication methods than basic, including X509,
166and authentication based not only with apacheExtUserObject, but also with
167classic posixAccount/Group, probably with use of other excellent modules
168like mod_authz_ldap and others..
169* testing with apache 2.2.x
170
171* testers are welcomed, probably some nullpointer and overflows possibility
172extists, anyway Apache The Greate works holds the line - I tested some
173generated module segfaults, and they doesn't break apache itself, module only.
This page took 1.359738 seconds and 5 git commands to generate.