Skip to content

Commit 93e7d0d

Browse files
author
Cocker Koch
committed
Narrow down Datatypes
- use Datatypes from Stdlib, particularly a Port now only accepts Stdlib::Port - use Variant[Integer, Pattern[/^[0-9]+$/]] where Strings represent Integers
1 parent 1393439 commit 93e7d0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+770
-752
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ When you declare this class with the default options, the module:
316316

317317
- Installs the appropriate Apache software package and [required Apache modules][`default_mods`] for your operating system.
318318
- Places the required configuration files in a directory, with the [default location][`conf_dir`] Depends on operating system.
319-
- Configures the server with a default virtual host and standard port ('80') and address ('\*') bindings.
319+
- Configures the server with a default virtual host and standard port (80) and address ('\*') bindings.
320320
- Creates a document root directory Depends on operating system, typically `/var/www`.
321321
- Starts the Apache service.
322322

@@ -345,7 +345,7 @@ To configure basic [name-based virtual hosts][], specify the [`port`][] and [`do
345345

346346
``` puppet
347347
apache::vhost { 'vhost.example.com':
348-
port => '80',
348+
port => 80,
349349
docroot => '/var/www/vhost',
350350
}
351351
```
@@ -358,7 +358,7 @@ To configure user and group ownership for `docroot`, use the [`docroot_owner`][]
358358

359359
``` puppet
360360
apache::vhost { 'user.example.com':
361-
port => '80',
361+
port => 80,
362362
docroot => '/var/www/user',
363363
docroot_owner => 'www-data',
364364
docroot_group => 'www-data',
@@ -367,11 +367,11 @@ apache::vhost { 'user.example.com':
367367

368368
#### Configuring virtual hosts with SSL
369369

370-
To configure a virtual host to use [SSL encryption][] and default SSL certificates, set the [`ssl`][] parameter. You must also specify the [`port`][] parameter, typically with a value of '443', to accommodate HTTPS requests:
370+
To configure a virtual host to use [SSL encryption][] and default SSL certificates, set the [`ssl`][] parameter. You must also specify the [`port`][] parameter, typically with a value of 443, to accommodate HTTPS requests:
371371

372372
``` puppet
373373
apache::vhost { 'ssl.example.com':
374-
port => '443',
374+
port => 443,
375375
docroot => '/var/www/ssl',
376376
ssl => true,
377377
}
@@ -381,7 +381,7 @@ To configure a virtual host to use SSL and specific SSL certificates, use the pa
381381

382382
``` puppet
383383
apache::vhost { 'cert.example.com':
384-
port => '443',
384+
port => 443,
385385
docroot => '/var/www/cert',
386386
ssl => true,
387387
ssl_cert => '/etc/ssl/fourth.example.com.cert',
@@ -395,14 +395,14 @@ To configure a mix of SSL and unencrypted virtual hosts at the same domain, decl
395395
# The non-ssl virtual host
396396
apache::vhost { 'mix.example.com non-ssl':
397397
servername => 'mix.example.com',
398-
port => '80',
398+
port => 80,
399399
docroot => '/var/www/mix',
400400
}
401401
402402
# The SSL virtual host at the same domain
403403
apache::vhost { 'mix.example.com ssl':
404404
servername => 'mix.example.com',
405-
port => '443',
405+
port => 443,
406406
docroot => '/var/www/mix',
407407
ssl => true,
408408
}
@@ -413,15 +413,15 @@ To configure a virtual host to redirect unencrypted connections to SSL, declare
413413
``` puppet
414414
apache::vhost { 'redirect.example.com non-ssl':
415415
servername => 'redirect.example.com',
416-
port => '80',
416+
port => 80,
417417
docroot => '/var/www/redirect',
418418
redirect_status => 'permanent',
419419
redirect_dest => 'https://redirect.example.com/'
420420
}
421421
422422
apache::vhost { 'redirect.example.com ssl':
423423
servername => 'redirect.example.com',
424-
port => '443',
424+
port => 443,
425425
docroot => '/var/www/redirect',
426426
ssl => true,
427427
}
@@ -434,7 +434,7 @@ Virtual hosts listen on all IP addresses ('\*') by default. To configure the vir
434434
``` puppet
435435
apache::vhost { 'ip.example.com':
436436
ip => '127.0.0.1',
437-
port => '80',
437+
port => 80,
438438
docroot => '/var/www/ip',
439439
}
440440
```
@@ -444,7 +444,7 @@ You can also configure more than one IP address per virtual host by using an arr
444444
``` puppet
445445
apache::vhost { 'ip.example.com':
446446
ip => ['127.0.0.1','169.254.1.1'],
447-
port => '80',
447+
port => 80,
448448
docroot => '/var/www/ip',
449449
}
450450
```
@@ -454,7 +454,7 @@ You can configure multiple ports per virtual host by using an array of ports for
454454
``` puppet
455455
apache::vhost { 'ip.example.com':
456456
ip => ['127.0.0.1'],
457-
port => ['80','8080']
457+
port => [80, 8080]
458458
docroot => '/var/www/ip',
459459
}
460460
```
@@ -467,7 +467,7 @@ apache::vhost { 'aliases.example.com':
467467
'aliases.example.org',
468468
'aliases.example.net',
469469
],
470-
port => '80',
470+
port => 80,
471471
docroot => '/var/www/aliases',
472472
}
473473
```
@@ -477,7 +477,7 @@ To set up a virtual host with a wildcard alias for the subdomain mapped to a dir
477477
``` puppet
478478
apache::vhost { 'subdomain.loc':
479479
vhost_name => '*',
480-
port => '80',
480+
port => 80,
481481
virtual_docroot => '/var/www/%-2+',
482482
docroot => '/var/www',
483483
serveraliases => ['*.loc',],
@@ -488,7 +488,7 @@ To configure a virtual host with [filter rules][], pass the filter directives as
488488

489489
``` puppet
490490
apache::vhost { 'subdomain.loc':
491-
port => '80',
491+
port => 80,
492492
filters => [
493493
'FilterDeclare COMPRESS',
494494
'FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html',
@@ -505,13 +505,13 @@ To configure a virtual host to use the [Web Server Gateway Interface][] (WSGI) f
505505

506506
``` puppet
507507
apache::vhost { 'wsgi.example.com':
508-
port => '80',
508+
port => 80,
509509
docroot => '/var/www/pythonapp',
510510
wsgi_application_group => '%{GLOBAL}',
511511
wsgi_daemon_process => 'wsgi',
512512
wsgi_daemon_process_options => {
513-
processes => '2',
514-
threads => '15',
513+
processes => 2,
514+
threads => 15,
515515
display-name => '%{GROUP}',
516516
},
517517
wsgi_import_script => '/var/www/demo.wsgi',
@@ -528,7 +528,7 @@ As of Apache 2.2.16, Apache supports [FallbackResource][], a simple replacement
528528

529529
``` puppet
530530
apache::vhost { 'wordpress.example.com':
531-
port => '80',
531+
port => 80,
532532
docroot => '/var/www/wordpress',
533533
fallbackresource => '/index.php',
534534
}
@@ -540,7 +540,7 @@ To configure a virtual host with a designated directory for [Common Gateway Inte
540540

541541
``` puppet
542542
apache::vhost { 'cgi.example.com':
543-
port => '80',
543+
port => 80,
544544
docroot => '/var/www/cgi',
545545
scriptalias => '/usr/lib/cgi-bin',
546546
}
@@ -550,7 +550,7 @@ To configure a virtual host for [Rack][], use the [`rack_base_uri`][] parameter:
550550

551551
``` puppet
552552
apache::vhost { 'rack.example.com':
553-
port => '80',
553+
port => 80,
554554
docroot => '/var/www/rack',
555555
rack_base_uri => ['/rackapp1', '/rackapp2'],
556556
}
@@ -590,15 +590,15 @@ In this example, we add two IP-based virtual hosts on an IP address (in this exa
590590
apache::vhost { 'The first IP-based virtual host, non-ssl':
591591
servername => 'first.example.com',
592592
ip => '10.0.0.10',
593-
port => '80',
593+
port => 80,
594594
ip_based => true,
595595
docroot => '/var/www/first',
596596
}
597597
598598
apache::vhost { 'The first IP-based vhost, ssl':
599599
servername => 'first.example.com',
600600
ip => '10.0.0.10',
601-
port => '443',
601+
port => 443,
602602
ip_based => true,
603603
docroot => '/var/www/first-ssl',
604604
ssl => true,
@@ -610,13 +610,13 @@ Next, we add two name-based virtual hosts listening on a second IP address (10.0
610610
``` puppet
611611
apache::vhost { 'second.example.com':
612612
ip => '10.0.0.20',
613-
port => '80',
613+
port => 80,
614614
docroot => '/var/www/second',
615615
}
616616
617617
apache::vhost { 'third.example.com':
618618
ip => '10.0.0.20',
619-
port => '80',
619+
port => 80,
620620
docroot => '/var/www/third',
621621
}
622622
```
@@ -625,13 +625,13 @@ To add name-based virtual hosts that answer on either 10.0.0.10 or 10.0.0.20, yo
625625

626626
``` puppet
627627
apache::vhost { 'fourth.example.com':
628-
port => '80',
628+
port => 80,
629629
docroot => '/var/www/fourth',
630630
add_listen => false,
631631
}
632632
633633
apache::vhost { 'fifth.example.com':
634-
port => '80',
634+
port => 80,
635635
docroot => '/var/www/fifth',
636636
add_listen => false,
637637
}

0 commit comments

Comments
 (0)