Skip to content

Commit 280ec5f

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 83d077b commit 280ec5f

Some content is hidden

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

72 files changed

+782
-765
lines changed

README.md

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

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

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

351351
``` puppet
352352
apache::vhost { 'vhost.example.com':
353-
port => '80',
353+
port => 80,
354354
docroot => '/var/www/vhost',
355355
}
356356
```
@@ -363,7 +363,7 @@ To configure user and group ownership for `docroot`, use the [`docroot_owner`][]
363363

364364
``` puppet
365365
apache::vhost { 'user.example.com':
366-
port => '80',
366+
port => 80,
367367
docroot => '/var/www/user',
368368
docroot_owner => 'www-data',
369369
docroot_group => 'www-data',
@@ -372,11 +372,11 @@ apache::vhost { 'user.example.com':
372372

373373
#### Configuring virtual hosts with SSL
374374

375-
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:
375+
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:
376376

377377
``` puppet
378378
apache::vhost { 'ssl.example.com':
379-
port => '443',
379+
port => 443,
380380
docroot => '/var/www/ssl',
381381
ssl => true,
382382
}
@@ -386,7 +386,7 @@ To configure a virtual host to use SSL and specific SSL certificates, use the pa
386386

387387
``` puppet
388388
apache::vhost { 'cert.example.com':
389-
port => '443',
389+
port => 443,
390390
docroot => '/var/www/cert',
391391
ssl => true,
392392
ssl_cert => '/etc/ssl/fourth.example.com.cert',
@@ -400,14 +400,14 @@ To configure a mix of SSL and unencrypted virtual hosts at the same domain, decl
400400
# The non-ssl virtual host
401401
apache::vhost { 'mix.example.com non-ssl':
402402
servername => 'mix.example.com',
403-
port => '80',
403+
port => 80,
404404
docroot => '/var/www/mix',
405405
}
406406
407407
# The SSL virtual host at the same domain
408408
apache::vhost { 'mix.example.com ssl':
409409
servername => 'mix.example.com',
410-
port => '443',
410+
port => 443,
411411
docroot => '/var/www/mix',
412412
ssl => true,
413413
}
@@ -418,15 +418,15 @@ To configure a virtual host to redirect unencrypted connections to SSL, declare
418418
``` puppet
419419
apache::vhost { 'redirect.example.com non-ssl':
420420
servername => 'redirect.example.com',
421-
port => '80',
421+
port => 80,
422422
docroot => '/var/www/redirect',
423423
redirect_status => 'permanent',
424424
redirect_dest => 'https://redirect.example.com/'
425425
}
426426
427427
apache::vhost { 'redirect.example.com ssl':
428428
servername => 'redirect.example.com',
429-
port => '443',
429+
port => 443,
430430
docroot => '/var/www/redirect',
431431
ssl => true,
432432
}
@@ -439,7 +439,7 @@ Virtual hosts listen on all IP addresses ('\*') by default. To configure the vir
439439
``` puppet
440440
apache::vhost { 'ip.example.com':
441441
ip => '127.0.0.1',
442-
port => '80',
442+
port => 80,
443443
docroot => '/var/www/ip',
444444
}
445445
```
@@ -449,7 +449,7 @@ You can also configure more than one IP address per virtual host by using an arr
449449
``` puppet
450450
apache::vhost { 'ip.example.com':
451451
ip => ['127.0.0.1','169.254.1.1'],
452-
port => '80',
452+
port => 80,
453453
docroot => '/var/www/ip',
454454
}
455455
```
@@ -459,7 +459,7 @@ You can configure multiple ports per virtual host by using an array of ports for
459459
``` puppet
460460
apache::vhost { 'ip.example.com':
461461
ip => ['127.0.0.1'],
462-
port => ['80','8080']
462+
port => [80, 8080]
463463
docroot => '/var/www/ip',
464464
}
465465
```
@@ -472,7 +472,7 @@ apache::vhost { 'aliases.example.com':
472472
'aliases.example.org',
473473
'aliases.example.net',
474474
],
475-
port => '80',
475+
port => 80,
476476
docroot => '/var/www/aliases',
477477
}
478478
```
@@ -482,7 +482,7 @@ To set up a virtual host with a wildcard alias for the subdomain mapped to a dir
482482
``` puppet
483483
apache::vhost { 'subdomain.loc':
484484
vhost_name => '*',
485-
port => '80',
485+
port => 80,
486486
virtual_docroot => '/var/www/%-2+',
487487
docroot => '/var/www',
488488
serveraliases => ['*.loc',],
@@ -493,7 +493,7 @@ To configure a virtual host with [filter rules][], pass the filter directives as
493493

494494
``` puppet
495495
apache::vhost { 'subdomain.loc':
496-
port => '80',
496+
port => 80,
497497
filters => [
498498
'FilterDeclare COMPRESS',
499499
'FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html',
@@ -517,7 +517,7 @@ For example:
517517

518518
``` puppet
519519
apache::vhost { 'suphp.example.com':
520-
port => '80',
520+
port => 80,
521521
docroot => '/home/appuser/myphpapp',
522522
suphp_addhandler => 'x-httpd-php',
523523
suphp_engine => 'on',
@@ -537,13 +537,13 @@ To configure a virtual host to use the [Web Server Gateway Interface][] (WSGI) f
537537

538538
``` puppet
539539
apache::vhost { 'wsgi.example.com':
540-
port => '80',
540+
port => 80,
541541
docroot => '/var/www/pythonapp',
542542
wsgi_application_group => '%{GLOBAL}',
543543
wsgi_daemon_process => 'wsgi',
544544
wsgi_daemon_process_options => {
545-
processes => '2',
546-
threads => '15',
545+
processes => 2,
546+
threads => 15,
547547
display-name => '%{GROUP}',
548548
},
549549
wsgi_import_script => '/var/www/demo.wsgi',
@@ -560,7 +560,7 @@ As of Apache 2.2.16, Apache supports [FallbackResource][], a simple replacement
560560

561561
``` puppet
562562
apache::vhost { 'wordpress.example.com':
563-
port => '80',
563+
port => 80,
564564
docroot => '/var/www/wordpress',
565565
fallbackresource => '/index.php',
566566
}
@@ -572,7 +572,7 @@ To configure a virtual host with a designated directory for [Common Gateway Inte
572572

573573
``` puppet
574574
apache::vhost { 'cgi.example.com':
575-
port => '80',
575+
port => 80,
576576
docroot => '/var/www/cgi',
577577
scriptalias => '/usr/lib/cgi-bin',
578578
}
@@ -582,7 +582,7 @@ To configure a virtual host for [Rack][], use the [`rack_base_uri`][] parameter:
582582

583583
``` puppet
584584
apache::vhost { 'rack.example.com':
585-
port => '80',
585+
port => 80,
586586
docroot => '/var/www/rack',
587587
rack_base_uri => ['/rackapp1', '/rackapp2'],
588588
}
@@ -593,9 +593,9 @@ apache::vhost { 'rack.example.com':
593593
You can configure [IP-based virtual hosts][] to listen on any port and have them respond to requests on specific IP addresses. In this example, the server listens on ports 80 and 81, because the example virtual hosts are _not_ declared with a [`port`][] parameter:
594594

595595
``` puppet
596-
apache::listen { '80': }
596+
apache::listen { 80: }
597597
598-
apache::listen { '81': }
598+
apache::listen { 81: }
599599
```
600600

601601
Configure the IP-based virtual hosts with the [`ip_based`][] parameter:
@@ -622,15 +622,15 @@ In this example, we add two IP-based virtual hosts on an IP address (in this exa
622622
apache::vhost { 'The first IP-based virtual host, non-ssl':
623623
servername => 'first.example.com',
624624
ip => '10.0.0.10',
625-
port => '80',
625+
port => 80,
626626
ip_based => true,
627627
docroot => '/var/www/first',
628628
}
629629
630630
apache::vhost { 'The first IP-based vhost, ssl':
631631
servername => 'first.example.com',
632632
ip => '10.0.0.10',
633-
port => '443',
633+
port => 443,
634634
ip_based => true,
635635
docroot => '/var/www/first-ssl',
636636
ssl => true,
@@ -642,13 +642,13 @@ Next, we add two name-based virtual hosts listening on a second IP address (10.0
642642
``` puppet
643643
apache::vhost { 'second.example.com':
644644
ip => '10.0.0.20',
645-
port => '80',
645+
port => 80,
646646
docroot => '/var/www/second',
647647
}
648648
649649
apache::vhost { 'third.example.com':
650650
ip => '10.0.0.20',
651-
port => '80',
651+
port => 80,
652652
docroot => '/var/www/third',
653653
}
654654
```
@@ -657,13 +657,13 @@ To add name-based virtual hosts that answer on either 10.0.0.10 or 10.0.0.20, yo
657657

658658
``` puppet
659659
apache::vhost { 'fourth.example.com':
660-
port => '80',
660+
port => 80,
661661
docroot => '/var/www/fourth',
662662
add_listen => false,
663663
}
664664
665665
apache::vhost { 'fifth.example.com':
666-
port => '80',
666+
port => 80,
667667
docroot => '/var/www/fifth',
668668
add_listen => false,
669669
}

0 commit comments

Comments
 (0)