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