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