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
- use Datatypes from Stdlib, particularly a Port now only accepts Stdlib::Port
- use Variant[Integer, Pattern[/^[0-9]+$/]] where Strings represent Integers
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:
376
376
377
377
```puppet
378
378
apache::vhost { 'ssl.example.com':
379
-
port => '443',
379
+
port => 443,
380
380
docroot => '/var/www/ssl',
381
381
ssl => true,
382
382
}
@@ -386,7 +386,7 @@ To configure a virtual host to use SSL and specific SSL certificates, use the pa
386
386
387
387
```puppet
388
388
apache::vhost { 'cert.example.com':
389
-
port => '443',
389
+
port => 443,
390
390
docroot => '/var/www/cert',
391
391
ssl => true,
392
392
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
400
400
# The non-ssl virtual host
401
401
apache::vhost { 'mix.example.com non-ssl':
402
402
servername => 'mix.example.com',
403
-
port => '80',
403
+
port => 80,
404
404
docroot => '/var/www/mix',
405
405
}
406
406
407
407
# The SSL virtual host at the same domain
408
408
apache::vhost { 'mix.example.com ssl':
409
409
servername => 'mix.example.com',
410
-
port => '443',
410
+
port => 443,
411
411
docroot => '/var/www/mix',
412
412
ssl => true,
413
413
}
@@ -418,15 +418,15 @@ To configure a virtual host to redirect unencrypted connections to SSL, declare
418
418
```puppet
419
419
apache::vhost { 'redirect.example.com non-ssl':
420
420
servername => 'redirect.example.com',
421
-
port => '80',
421
+
port => 80,
422
422
docroot => '/var/www/redirect',
423
423
redirect_status => 'permanent',
424
424
redirect_dest => 'https://redirect.example.com/'
425
425
}
426
426
427
427
apache::vhost { 'redirect.example.com ssl':
428
428
servername => 'redirect.example.com',
429
-
port => '443',
429
+
port => 443,
430
430
docroot => '/var/www/redirect',
431
431
ssl => true,
432
432
}
@@ -439,7 +439,7 @@ Virtual hosts listen on all IP addresses ('\*') by default. To configure the vir
439
439
```puppet
440
440
apache::vhost { 'ip.example.com':
441
441
ip => '127.0.0.1',
442
-
port => '80',
442
+
port => 80,
443
443
docroot => '/var/www/ip',
444
444
}
445
445
```
@@ -449,7 +449,7 @@ You can also configure more than one IP address per virtual host by using an arr
449
449
```puppet
450
450
apache::vhost { 'ip.example.com':
451
451
ip => ['127.0.0.1','169.254.1.1'],
452
-
port => '80',
452
+
port => 80,
453
453
docroot => '/var/www/ip',
454
454
}
455
455
```
@@ -459,7 +459,7 @@ You can configure multiple ports per virtual host by using an array of ports for
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:
594
594
595
595
```puppet
596
-
apache::listen { '80': }
596
+
apache::listen { 80: }
597
597
598
-
apache::listen { '81': }
598
+
apache::listen { 81: }
599
599
```
600
600
601
601
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
622
622
apache::vhost { 'The first IP-based virtual host, non-ssl':
623
623
servername => 'first.example.com',
624
624
ip => '10.0.0.10',
625
-
port => '80',
625
+
port => 80,
626
626
ip_based => true,
627
627
docroot => '/var/www/first',
628
628
}
629
629
630
630
apache::vhost { 'The first IP-based vhost, ssl':
631
631
servername => 'first.example.com',
632
632
ip => '10.0.0.10',
633
-
port => '443',
633
+
port => 443,
634
634
ip_based => true,
635
635
docroot => '/var/www/first-ssl',
636
636
ssl => true,
@@ -642,13 +642,13 @@ Next, we add two name-based virtual hosts listening on a second IP address (10.0
642
642
```puppet
643
643
apache::vhost { 'second.example.com':
644
644
ip => '10.0.0.20',
645
-
port => '80',
645
+
port => 80,
646
646
docroot => '/var/www/second',
647
647
}
648
648
649
649
apache::vhost { 'third.example.com':
650
650
ip => '10.0.0.20',
651
-
port => '80',
651
+
port => 80,
652
652
docroot => '/var/www/third',
653
653
}
654
654
```
@@ -657,13 +657,13 @@ To add name-based virtual hosts that answer on either 10.0.0.10 or 10.0.0.20, yo
0 commit comments