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:
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:
371
371
372
372
```puppet
373
373
apache::vhost { 'ssl.example.com':
374
-
port => '443',
374
+
port => 443,
375
375
docroot => '/var/www/ssl',
376
376
ssl => true,
377
377
}
@@ -381,7 +381,7 @@ To configure a virtual host to use SSL and specific SSL certificates, use the pa
381
381
382
382
```puppet
383
383
apache::vhost { 'cert.example.com':
384
-
port => '443',
384
+
port => 443,
385
385
docroot => '/var/www/cert',
386
386
ssl => true,
387
387
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
395
395
# The non-ssl virtual host
396
396
apache::vhost { 'mix.example.com non-ssl':
397
397
servername => 'mix.example.com',
398
-
port => '80',
398
+
port => 80,
399
399
docroot => '/var/www/mix',
400
400
}
401
401
402
402
# The SSL virtual host at the same domain
403
403
apache::vhost { 'mix.example.com ssl':
404
404
servername => 'mix.example.com',
405
-
port => '443',
405
+
port => 443,
406
406
docroot => '/var/www/mix',
407
407
ssl => true,
408
408
}
@@ -413,15 +413,15 @@ To configure a virtual host to redirect unencrypted connections to SSL, declare
413
413
```puppet
414
414
apache::vhost { 'redirect.example.com non-ssl':
415
415
servername => 'redirect.example.com',
416
-
port => '80',
416
+
port => 80,
417
417
docroot => '/var/www/redirect',
418
418
redirect_status => 'permanent',
419
419
redirect_dest => 'https://redirect.example.com/'
420
420
}
421
421
422
422
apache::vhost { 'redirect.example.com ssl':
423
423
servername => 'redirect.example.com',
424
-
port => '443',
424
+
port => 443,
425
425
docroot => '/var/www/redirect',
426
426
ssl => true,
427
427
}
@@ -434,7 +434,7 @@ Virtual hosts listen on all IP addresses ('\*') by default. To configure the vir
434
434
```puppet
435
435
apache::vhost { 'ip.example.com':
436
436
ip => '127.0.0.1',
437
-
port => '80',
437
+
port => 80,
438
438
docroot => '/var/www/ip',
439
439
}
440
440
```
@@ -444,7 +444,7 @@ You can also configure more than one IP address per virtual host by using an arr
444
444
```puppet
445
445
apache::vhost { 'ip.example.com':
446
446
ip => ['127.0.0.1','169.254.1.1'],
447
-
port => '80',
447
+
port => 80,
448
448
docroot => '/var/www/ip',
449
449
}
450
450
```
@@ -454,7 +454,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:
562
562
563
563
```puppet
564
-
apache::listen { '80': }
564
+
apache::listen { 80: }
565
565
566
-
apache::listen { '81': }
566
+
apache::listen { 81: }
567
567
```
568
568
569
569
Configure the IP-based virtual hosts with the [`ip_based`][] parameter:
@@ -590,15 +590,15 @@ In this example, we add two IP-based virtual hosts on an IP address (in this exa
590
590
apache::vhost { 'The first IP-based virtual host, non-ssl':
591
591
servername => 'first.example.com',
592
592
ip => '10.0.0.10',
593
-
port => '80',
593
+
port => 80,
594
594
ip_based => true,
595
595
docroot => '/var/www/first',
596
596
}
597
597
598
598
apache::vhost { 'The first IP-based vhost, ssl':
599
599
servername => 'first.example.com',
600
600
ip => '10.0.0.10',
601
-
port => '443',
601
+
port => 443,
602
602
ip_based => true,
603
603
docroot => '/var/www/first-ssl',
604
604
ssl => true,
@@ -610,13 +610,13 @@ Next, we add two name-based virtual hosts listening on a second IP address (10.0
610
610
```puppet
611
611
apache::vhost { 'second.example.com':
612
612
ip => '10.0.0.20',
613
-
port => '80',
613
+
port => 80,
614
614
docroot => '/var/www/second',
615
615
}
616
616
617
617
apache::vhost { 'third.example.com':
618
618
ip => '10.0.0.20',
619
-
port => '80',
619
+
port => 80,
620
620
docroot => '/var/www/third',
621
621
}
622
622
```
@@ -625,13 +625,13 @@ To add name-based virtual hosts that answer on either 10.0.0.10 or 10.0.0.20, yo
0 commit comments