1 This document describes how to use group-based authorization using my
2 version of mod_auth_mysql.c. This version is based heavily on my own
3 version of mod_auth_msql.c, which was widely distributed prior to the
4 one currently shipped with Apache.
6 There are two options to using groups. You can put the "user_group"
7 field into the same table as the user database if each user is in only
8 one group, or you can have a separate table that contains the fields
9 "user_name" and "user_group" if each user is a member of multiple
12 If the user_group field is part of the full user table, the table has
13 three fields at least: user_name, user_group, user_passwd. The
14 user_group field must be "PRIMARY KEY" in the user database containing
15 a password. The htaccess file would be this:
17 AuthName My Authorization
19 AuthGroupFile /dev/null
20 AuthMySQLHost localhost
22 AuthMySQLUserTable user_info
23 AuthMySQLGroupField user_group
26 If you have a separate database for groups, the two tables would be
28 user_info: user_name, user_passwd (user_name must be PRIMARY KEY)
29 user_group: user_name, user_group (user is not PRIMARY KEY, as we have
30 multiple tuples for user_name,user_group to let a user be in
33 and htaccess would have this:
35 AuthName My Authorzation
37 AuthGroupFile /dev/null
38 AuthMySQLHost localhost
40 AuthMySQLUserTable user_info
42 AuthMySQLGroupTable my_groups
43 AuthMySQLGroupField user_group
48 Assuming that the required group name is "admin".