Skip to content

Commit e9d22e0

Browse files
committed
Merge pull request #253 from richardc/vhost_directories_usage
make directories examples real puppet DSL
2 parents c029b46 + bb13c55 commit e9d22e0

File tree

1 file changed

+38
-27
lines changed

1 file changed

+38
-27
lines changed

README.md

+38-27
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,15 @@ Sets a given `apache::vhost` as the default to serve requests that do not match
339339

340340
#####`directories`
341341

342-
Passes a list of hashes to the vhost to create `<Directory /path/to/directory>...</Directory>` directive blocks as per the [Apache core documentation](http://httpd.apache.org/docs/2.2/mod/core.html#directory). Each hash should be of the form of:
342+
Passes a list of hashes to the vhost to create `<Directory /path/to/directory>...</Directory>` directive blocks as per the [Apache core documentation](http://httpd.apache.org/docs/2.2/mod/core.html#directory). The `path` key is required in these hashes. Usage will typically look like:
343343

344-
```ruby
345-
directory => [ { path => '/path/to/directory', <directive> => <value> } ],
346-
```
344+
apache::vhost { 'sample.example.net':
345+
docroot => '/path/to/directory',
346+
directories => [
347+
{ path => '/path/to/directory', <directive> => <value> },
348+
{ path => '/path/to/another/directory', <directive> => <value> },
349+
],
350+
}
347351

348352
*Note:* At least one directory should match `docroot` parameter, once you start declaring directories `apache::vhost` assumes that all required `<Directory>` blocks will be declared.
349353

@@ -356,58 +360,65 @@ The directives will be embedded within the `Directory` directive block, missing
356360
Sets `AddHandler` directives as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler). Accepts a list of hashes of the form `{ handler => 'handler-name', extensions => ['extension']}`. Note that `extensions` is a list of extenstions being handled by the handler.
357361
An example:
358362

359-
```ruby
360-
directory => [ { path => '/path/to/directory',
361-
addhandlers => [ { handler => 'cgi-script', extensions => ['.cgi']} ]
362-
} ]
363-
```
363+
apache::vhost { 'sample.example.net':
364+
docroot => '/path/to/directory',
365+
directories => [ { path => '/path/to/directory',
366+
addhandlers => [ { handler => 'cgi-script', extensions => ['.cgi']} ],
367+
} ],
368+
}
364369

365370
######`allow`
366371

367372
Sets an `Allow` directive as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow). An example:
368373

369-
```ruby
370-
directory => [ { path => '/path/to/directory', allow => 'from example.org' } ],
371-
```
374+
apache::vhost { 'sample.example.net':
375+
docroot => '/path/to/directory',
376+
directories => [ { path => '/path/to/directory', allow => 'from example.org' } ],
377+
}
372378

373379
######`allow_override`
374380

375381
Sets the usage of `.htaccess` files as per the [Apache core documentation](http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride). Should accept in the form of a list or a string. An example:
376382

377-
```ruby
378-
directory => [ { path => '/path/to/directory', allow_override => ['AuthConfig', 'Indexes'] } ],
379-
```
383+
apache::vhost { 'sample.example.net':
384+
docroot => '/path/to/directory',
385+
directories => [ { path => '/path/to/directory', allow_override => ['AuthConfig', 'Indexes'] } ],
386+
}
380387

381388
######`deny`
382389

383390
Sets an `Deny` directive as per the [Apache Core documentation](http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#deny). An example:
384391

385-
```ruby
386-
directory => [ { path => '/path/to/directory', deny => 'from example.org' } ],
387-
```
392+
apache::vhost { 'sample.example.net':
393+
docroot => '/path/to/directory',
394+
directories => [ { path => '/path/to/directory', deny => 'from example.org' } ],
395+
}
388396

389397
######`options`
390398

391399
Lists the options for the given `<Directory>` block
392400

393-
```ruby
394-
directory => [ { path => '/path/to/directory', options => ['Indexes','FollowSymLinks','MultiViews'] }]
395-
```
401+
apache::vhost { 'sample.example.net':
402+
docroot => '/path/to/directory',
403+
directories => [ { path => '/path/to/directory', options => ['Indexes','FollowSymLinks','MultiViews'] }],
404+
}
396405

397406
######`order`
398407
Sets the order of processing `Allow` and `Deny` statements as per [Apache core documentation](http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#order). An example:
399408

400-
```ruby
401-
directory => [ { path => '/path/to/directory', order => 'Allow, Deny' } ],
402-
```
409+
apache::vhost { 'sample.example.net':
410+
docroot => '/path/to/directory',
411+
directories => [ { path => '/path/to/directory', order => 'Allow, Deny' } ],
412+
}
403413

404414
######`passenger_enabled`
405415

406416
Sets the value for the `PassengerEnabled` directory to `on` or `off` as per the [Passenger documentation](http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerEnabled).
407417

408-
```ruby
409-
directory => [ { path => '/path/to/directory', passenger_enabled => 'off' } ],
410-
```
418+
apache::vhost { 'sample.example.net':
419+
docroot => '/path/to/directory',
420+
directories => [ { path => '/path/to/directory', passenger_enabled => 'off' } ],
421+
}
411422

412423
**Note:** This directive requires `apache::mod::passenger` to be active, Apache may not start with an unrecognised directive without it.
413424

0 commit comments

Comments
 (0)