You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1418,6 +1418,20 @@ Sets the order of processing Allow and Deny statements as per [Apache core docum
1418
1418
}
1419
1419
```
1420
1420
1421
+
######`satisfy`
1422
+
1423
+
Sets a `Satisfy` directive as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/core.html#satisfy). **Deprecated:** This parameter is being deprecated due to a change in Apache. It will only work with Apache 2.2 and lower.
1424
+
1425
+
```puppet
1426
+
apache::vhost { 'sample.example.net':
1427
+
docroot => '/path/to/directory',
1428
+
directories => [
1429
+
{ path => '/path/to/directory',
1430
+
satisfy => 'Any',
1431
+
}
1432
+
],
1433
+
}
1434
+
1421
1435
######`sethandler`
1422
1436
1423
1437
Sets a `SetHandler` directive as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/core.html#sethandler). An example:
it'should configure a vhost with Satisfy and Auth directive'do
303
+
pp=<<-EOS
304
+
class { 'apache': }
305
+
host { 'files.example.net': ip => '127.0.0.1', }
306
+
apache::vhost { 'files.example.net':
307
+
docroot => '/var/www/files',
308
+
directories => [
309
+
{
310
+
path => '/var/www/files/foo',
311
+
auth_type => 'Basic',
312
+
auth_name => 'Basic Auth',
313
+
auth_user_file => '/var/www/htpasswd',
314
+
auth_require => "valid-user",
315
+
},
316
+
{
317
+
path => '/var/www/files/bar',
318
+
auth_type => 'Basic',
319
+
auth_name => 'Basic Auth',
320
+
auth_user_file => '/var/www/htpasswd',
321
+
auth_require => 'valid-user',
322
+
satisfy => 'Any',
323
+
},
324
+
{
325
+
path => '/var/www/files/baz',
326
+
allow => 'from 10.10.10.10',
327
+
auth_type => 'Basic',
328
+
auth_name => 'Basic Auth',
329
+
auth_user_file => '/var/www/htpasswd',
330
+
auth_require => 'valid-user',
331
+
satisfy => 'Any',
332
+
},
333
+
],
334
+
}
335
+
file { '/var/www/files/foo':
336
+
ensure => directory,
337
+
}
338
+
file { '/var/www/files/bar':
339
+
ensure => directory,
340
+
}
341
+
file { '/var/www/files/baz':
342
+
ensure => directory,
343
+
}
344
+
file { '/var/www/files/foo/index.html':
345
+
ensure => file,
346
+
content => "Hello World\\n",
347
+
}
348
+
file { '/var/www/files/bar/index.html':
349
+
ensure => file,
350
+
content => "Hello World\\n",
351
+
}
352
+
file { '/var/www/files/baz/index.html':
353
+
ensure => file,
354
+
content => "Hello World\\n",
355
+
}
356
+
file { '/var/www/htpasswd':
357
+
ensure => file,
358
+
content => "login:IZ7jMcLSx0oQk", # "password" as password
359
+
}
360
+
EOS
361
+
apply_manifest(pp,:catch_failures=>true)
362
+
end
363
+
364
+
describeservice($service_name)do
365
+
it{shouldbe_enabled}
366
+
it{shouldbe_running}
367
+
end
368
+
369
+
it'should answer to files.example.net'do
370
+
shell("/usr/bin/curl -sSf files.example.net:80/foo/index.html",{:acceptable_exit_codes=>22}).stderr.shouldmatch(/curl: \(22\) The requested URL returned error: 401/)
shell("/usr/bin/curl -sSf files.example.net:80/baz/index.html",{:acceptable_exit_codes=>22}).stderr.shouldmatch(/curl: \(22\) The requested URL returned error: 401/)
0 commit comments