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
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:
366
+
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
367
372
368
```puppet
373
369
apache::vhost { 'ssl.example.com':
374
-
port => '443',
370
+
port => 443,
375
371
docroot => '/var/www/ssl',
376
372
ssl => true,
377
373
}
@@ -381,7 +377,7 @@ To configure a virtual host to use SSL and specific SSL certificates, use the pa
381
377
382
378
```puppet
383
379
apache::vhost { 'cert.example.com':
384
-
port => '443',
380
+
port => 443,
385
381
docroot => '/var/www/cert',
386
382
ssl => true,
387
383
ssl_cert => '/etc/ssl/fourth.example.com.cert',
@@ -395,14 +391,14 @@ To configure a mix of SSL and unencrypted virtual hosts at the same domain, decl
395
391
# The non-ssl virtual host
396
392
apache::vhost { 'mix.example.com non-ssl':
397
393
servername => 'mix.example.com',
398
-
port => '80',
394
+
port => 80,
399
395
docroot => '/var/www/mix',
400
396
}
401
397
402
398
# The SSL virtual host at the same domain
403
399
apache::vhost { 'mix.example.com ssl':
404
400
servername => 'mix.example.com',
405
-
port => '443',
401
+
port => 443,
406
402
docroot => '/var/www/mix',
407
403
ssl => true,
408
404
}
@@ -413,15 +409,15 @@ To configure a virtual host to redirect unencrypted connections to SSL, declare
413
409
```puppet
414
410
apache::vhost { 'redirect.example.com non-ssl':
415
411
servername => 'redirect.example.com',
416
-
port => '80',
412
+
port => 80,
417
413
docroot => '/var/www/redirect',
418
414
redirect_status => 'permanent',
419
415
redirect_dest => 'https://redirect.example.com/'
420
416
}
421
417
422
418
apache::vhost { 'redirect.example.com ssl':
423
419
servername => 'redirect.example.com',
424
-
port => '443',
420
+
port => 443,
425
421
docroot => '/var/www/redirect',
426
422
ssl => true,
427
423
}
@@ -434,7 +430,7 @@ Virtual hosts listen on all IP addresses ('\*') by default. To configure the vir
434
430
```puppet
435
431
apache::vhost { 'ip.example.com':
436
432
ip => '127.0.0.1',
437
-
port => '80',
433
+
port => 80,
438
434
docroot => '/var/www/ip',
439
435
}
440
436
```
@@ -444,7 +440,7 @@ You can also configure more than one IP address per virtual host by using an arr
444
440
```puppet
445
441
apache::vhost { 'ip.example.com':
446
442
ip => ['127.0.0.1','169.254.1.1'],
447
-
port => '80',
443
+
port => 80,
448
444
docroot => '/var/www/ip',
449
445
}
450
446
```
@@ -454,7 +450,7 @@ You can configure multiple ports per virtual host by using an array of ports for
There are several optional parameters you can specify when defining Apache modules this way. See the [defined type's reference][`apache::mod`] for details.
Please note you have to adjust the second ProxyPassMatch parameter to your docroot value (here `/var/www/html/`).
701
-
702
-
#### Other OSes
703
-
704
-
Add the [`apache::fastcgi::server`][] defined type to allow [FastCGI][] servers to handle requests for specific files. For example, the following defines a FastCGI server at 127.0.0.1 (localhost) on port 9000 to handle PHP requests:
705
-
706
-
```puppet
707
-
apache::fastcgi::server { 'php':
708
-
host => '127.0.0.1:9000',
709
-
timeout => 15,
710
-
flush => false,
711
-
faux_path => '/var/www/php.fcgi',
712
-
fcgi_alias => '/php.fcgi',
713
-
file_type => 'application/x-httpd-php'
714
-
}
715
-
```
716
-
717
-
You can then use the [`custom_fragment`][] parameter to configure the virtual host to have the FastCGI server handle the specified file type:
0 commit comments