summaryrefslogtreecommitdiff
blob: f33ced4bdda0ffe37ec1b2a7bc4ef8e9e5e06098 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<IfDefine AUTH_MYSQL>
LoadModule mysql_auth_module modules/mod_auth_mysql.so

# mod_auth_mysql can be used to limit access to documents by checking
# data in a MySQL database.

# This will enable user-based MySQL authentication of everything
# within /home/httpd.  You'll need to do the following as the MySQL
# root user beforehand:
#
#    CREATE DATABASE auth;
#    USE auth;
#    CREATE TABLE users (
#      user_name CHAR(30) NOT NULL,
#      user_passwd CHAR(20) NOT NULL,
#      PRIMARY KEY (user_name)
#    );
#    GRANT SELECT
#      ON auth.users
#      TO authuser@localhost
#      IDENTIFIED BY 'PaSsW0Rd';
#
#    INSERT INTO users VALUES ('testuser', ENCRYPT('testpass'));
#
#<Directory /home/httpd>
#	# If you want tot make mod_auth_mysql work with apache-2.2, please uncomment
#	# the following line:
#	#AuthBasicAuthoritative Off
#	AuthName "MySQL authenticated zone"
#	AuthType Basic
#
#	AuthMySQLUser authuser
#	AuthMySQLPassword PaSsW0Rd
#	AuthMySQLDB auth
#	AuthMySQLUserTable users
#	AuthMySQLNameField user_name
#	AuthMySQLPasswordField user_passwd
#
#	require valid-user
#</Directory>

# This will enable group-based MySQL authentication of everything
# within /home/httpd.  You'll need to do the following as the MySQL
# root user beforehand:
#
#    CREATE DATABASE auth;
#    USE auth;
#    CREATE TABLE users (
#      user_name CHAR(30) NOT NULL,
#      user_passwd CHAR(20) NOT NULL,
#      user_group CHAR(20) NOT NULL,
#      PRIMARY KEY (user_name)
#    );
#    GRANT SELECT
#      ON auth.users
#      TO authuser@localhost
#      IDENTIFIED BY 'PaSsW0Rd';
#
#    INSERT INTO users VALUES ('testuser',  ENCRYPT('testpass'), 'user');
#    INSERT INTO users VALUES ('testadmin', ENCRYPT('testpass'), 'admin');
#
#<Directory /home/httpd>
#	# If you want tot make mod_auth_mysql work with apache-2.2, please uncomment
#	# the following line:
#	#AuthBasicAuthoritative Off
#	AuthName "MySQL group authenticated zone"
#	AuthType Basic
#
#	AuthMySQLUser authuser
#	AuthMySQLPassword PaSsW0Rd
#	AuthMySQLDB auth
#	AuthMySQLUserTable users
#	AuthMySQLNameField user_name
#	AuthMySQLPasswordField user_passwd
#	AuthMySQLGroupField user_group
#
#	require group admin
#</Directory>

# Like the above this enables group-based MySQL authentication of
# everything within /home/httpd, but this configuration allows users to
# belong to more than one group.  You'll need to do the following as
# the MySQL root user beforehand:
#
#    CREATE DATABASE auth;
#    USE auth;
#    CREATE TABLE users (
#      user_name CHAR(30) NOT NULL,
#      user_passwd CHAR(20) NOT NULL,
#      PRIMARY KEY (user_name)
#    );
#    CREATE TABLE groups (
#      user_name CHAR(30) NOT NULL,
#      user_group CHAR(20) NOT NULL,
#      PRIMARY KEY (user_name, user_group)
#    );
#    GRANT SELECT
#      ON auth.users
#      TO authuser@localhost
#      IDENTIFIED BY 'PaSsW0Rd';
#    GRANT SELECT
#      ON auth.groups
#      TO authuser@localhost
#      IDENTIFIED BY 'PaSsW0Rd';
#
#    INSERT INTO users VALUES ('testuser',  ENCRYPT('testpass'));
#    INSERT INTO groups VALUES ('testuser', 'user');
#    INSERT INTO users VALUES ('testadmin', ENCRYPT('testpass'));
#    INSERT INTO groups VALUES ('testadmin', 'admin');
#    INSERT INTO groups VALUES ('testadmin', 'user');
#
#<Directory /home/httpd>
#	# If you want tot make mod_auth_mysql work with apache-2.2, please uncomment
#	# the following line:
#	#AuthBasicAuthoritative Off
#	AuthName "MySQL group authenticated zone"
#	AuthType Basic
#
#	AuthMySQLUser authuser
#	AuthMySQLPassword PaSsW0Rd
#	AuthMySQLDB auth
#	AuthMySQLUserTable users
#	AuthMySQLNameField user_name
#	AuthMySQLPasswordField user_passwd
#	AuthMySQLGroupTable groups
#	AuthMySQLGroupField user_group
#
#	require group user
#</Directory>
</IfDefine>

# vim: ts=4 filetype=apache