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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
# http.conf used for testing auth-test
ServerName 127.0.0.1
Listen 127.0.0.1:47524
PidFile @builddir@/httpd.pid
DocumentRoot @srcdir@
# The tests shut down apache with "graceful-stop", because that makes
# it close its listening socket right away. But it seems to sometimes
# result in apache never fully exiting. This fixes that.
GracefulShutdownTimeout 1
# Change this to "./error.log" if it's failing and you don't know why
ErrorLog /dev/null
LoadModule alias_module @APACHE_MODULE_DIR@/mod_alias.so
LoadModule auth_basic_module @APACHE_MODULE_DIR@/mod_auth_basic.so
LoadModule auth_digest_module @APACHE_MODULE_DIR@/mod_auth_digest.so
LoadModule authn_file_module @APACHE_MODULE_DIR@/mod_authn_file.so
LoadModule authz_host_module @APACHE_MODULE_DIR@/mod_authz_host.so
LoadModule authz_user_module @APACHE_MODULE_DIR@/mod_authz_user.so
LoadModule dir_module @APACHE_MODULE_DIR@/mod_dir.so
LoadModule mime_module @APACHE_MODULE_DIR@/mod_mime.so
@IF_HAVE_PHP@LoadModule php5_module @APACHE_PHP_MODULE_DIR@/@APACHE_PHP_MODULE@
LoadModule proxy_module @APACHE_MODULE_DIR@/mod_proxy.so
LoadModule proxy_http_module @APACHE_MODULE_DIR@/mod_proxy_http.so
LoadModule proxy_connect_module @APACHE_MODULE_DIR@/mod_proxy_connect.so
LoadModule ssl_module @APACHE_SSL_MODULE_DIR@/mod_ssl.so
DirectoryIndex index.txt
TypesConfig /dev/null
AddType application/x-httpd-php .php
Redirect permanent /redirected /index.txt
# Proxy #1: unauthenticated
Listen 127.0.0.1:47526
<VirtualHost 127.0.0.1:47526>
ProxyRequests On
AllowCONNECT 47525
# Deny proxying by default
<Proxy *>
Order Deny,Allow
Deny from all
</Proxy>
# Allow local http connections
<Proxy http://127.0.0.1*>
Order Allow,Deny
Allow from all
</Proxy>
# Allow CONNECT to local https port
<Proxy 127.0.0.1:47525>
Order Allow,Deny
Allow from all
</Proxy>
# Deny non-proxy requests
<Directory />
Order Deny,Allow
Deny from all
</Directory>
</VirtualHost>
# Proxy #2: authenticated
Listen 127.0.0.1:47527
<VirtualHost 127.0.0.1:47527>
ProxyRequests On
AllowCONNECT 47525
# Deny proxying by default
<Proxy *>
Order Deny,Allow
Deny from all
</Proxy>
# Allow local http connections with authentication
<Proxy http://127.0.0.1:47524*>
Order Allow,Deny
Allow from all
AuthType Basic
AuthName realm1
AuthUserFile @srcdir@/htpasswd
Require valid-user
</Proxy>
# Allow CONNECT to local https port with authentication
<Proxy 127.0.0.1:47525>
Order Allow,Deny
Allow from all
AuthType Basic
AuthName realm1
AuthUserFile @srcdir@/htpasswd
Require valid-user
</Proxy>
# Fail non-proxy requests
<Directory />
Order Deny,Allow
Deny from all
</Directory>
</VirtualHost>
# Proxy #3: unauthenticatable-to
Listen 127.0.0.1:47528
<VirtualHost 127.0.0.1:47528>
ProxyRequests On
AllowCONNECT 47525
# Deny proxying by default
<Proxy *>
Order Deny,Allow
Deny from all
</Proxy>
# Allow local http connections with authentication
<Proxy http://127.0.0.1:47524*>
Order Allow,Deny
Allow from all
AuthType Basic
AuthName realm1
AuthUserFile @srcdir@/htpasswd
Require user no-such-user
</Proxy>
# Allow CONNECT to local https port with authentication
<Proxy 127.0.0.1:47525>
Order Allow,Deny
Allow from all
AuthType Basic
AuthName realm1
AuthUserFile @srcdir@/htpasswd
Require user no-such-user
</Proxy>
# Fail non-proxy requests
<Directory />
Order Deny,Allow
Deny from all
</Directory>
</VirtualHost>
# SSL setup
<IfModule mod_ssl.c>
Listen 127.0.0.1:47525
<VirtualHost 127.0.0.1:47525>
SSLEngine on
SSLCertificateFile @srcdir@/test-cert.pem
SSLCertificateKeyFile @srcdir@/test-key.pem
</VirtualHost>
</IfModule>
# Basic auth tests
Alias /Basic/realm1/realm2/realm1 @srcdir@
Alias /Basic/realm1/realm2 @srcdir@
Alias /Basic/realm1/subdir @srcdir@
Alias /Basic/realm1/not @srcdir@
Alias /Basic/realm1 @srcdir@
Alias /Basic/realm12/subdir @srcdir@
Alias /Basic/realm12 @srcdir@
Alias /Basic/realm2 @srcdir@
Alias /Basic/realm3 @srcdir@
Alias /Basic @srcdir@
<Location /Basic/realm1>
AuthType Basic
AuthName realm1
AuthUserFile @srcdir@/htpasswd
Require user user1
</Location>
<Location /Basic/realm1/not>
AuthType Basic
AuthName realm1
AuthUserFile @srcdir@/htpasswd
Require user user2
</Location>
<Location /Basic/realm12>
AuthType Basic
AuthName realm12
AuthUserFile @srcdir@/htpasswd
Require user user1 user2
</Location>
<Location /Basic/realm1/realm2>
AuthType Basic
AuthName realm2
AuthUserFile @srcdir@/htpasswd
Require user user2
</Location>
<Location /Basic/realm1/realm2/realm1>
AuthType Basic
AuthName realm1
AuthUserFile @srcdir@/htpasswd
Require user user1
</Location>
<Location /Basic/realm2>
AuthType Basic
AuthName realm2
AuthUserFile @srcdir@/htpasswd
Require user user2
</Location>
<Location /Basic/realm3>
AuthType Basic
AuthName realm3
AuthUserFile @srcdir@/htpasswd
Require user user3
</Location>
# Digest auth tests
Alias /Digest/realm1/realm2/realm1 @srcdir@
Alias /Digest/realm1/realm2 @srcdir@
Alias /Digest/realm1/subdir @srcdir@
Alias /Digest/realm1/expire @srcdir@
Alias /Digest/realm1/not @srcdir@
Alias /Digest/realm1 @srcdir@
Alias /Digest/realm2 @srcdir@
Alias /Digest/realm3 @srcdir@
Alias /Digest @srcdir@
<Location /Digest/realm1>
AuthType Digest
AuthName realm1
AuthUserFile @srcdir@/htdigest
AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1
Require valid-user
</Location>
<Location /Digest/realm1/expire>
AuthType Digest
AuthName realm1
AuthUserFile @srcdir@/htdigest
AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1
AuthDigestNonceLifetime 2
Require valid-user
</Location>
<Location /Digest/realm1/not>
AuthType Digest
AuthName realm1
AuthUserFile @srcdir@/htdigest
AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1
Require user user2
</Location>
<Location /Digest/realm1/realm2>
AuthType Digest
AuthName realm2
AuthUserFile @srcdir@/htdigest
AuthDigestDomain /Digest/realm2 /Digest/realm1/realm2
Require valid-user
</Location>
<Location /Digest/realm1/realm2/realm1>
AuthType Digest
AuthName realm1
AuthUserFile @srcdir@/htdigest
AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1
Require valid-user
</Location>
<Location /Digest/realm2>
AuthType Digest
AuthName realm2
AuthUserFile @srcdir@/htdigest
AuthDigestDomain /Digest/realm2 /Digest/realm1/realm2
Require valid-user
</Location>
<Location /Digest/realm3>
AuthType Digest
AuthName realm3
AuthUserFile @srcdir@/htdigest
AuthDigestDomain /Digest/realm3
Require valid-user
# test RFC2069-style Digest
AuthDigestQop none
</Location>
|