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