Skip to content

Commit 067068a

Browse files
committed
Merge branch 'puppetlabs-main' into main
2 parents d52060e + 8a5c3bc commit 067068a

Some content is hidden

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

82 files changed

+811
-1111
lines changed

.puppet-lint.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
--relative
22
--no-anchor_resource-check
3+
--no-140chars-check

.sync.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ changelog_since_tag: "3.2.0"
3838
Rakefile:
3939
extra_disabled_lint_checks:
4040
- anchor_resource
41+
- 140chars

README.md

Lines changed: 28 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
[Installing Apache modules]: #installing-apache-modules
1515
[Installing arbitrary modules]: #installing-arbitrary-modules
1616
[Installing specific modules]: #installing-specific-modules
17-
[Configuring FastCGI servers]: #configuring-fastcgi-servers-to-handle-php-files
1817
[Load balancing examples]: #load-balancing-examples
1918
[apache affects]: #what-the-apache-module-affects
2019

@@ -34,7 +33,6 @@
3433
[`apache_version`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apache_version
3534
[`apache::balancer`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachebalancer
3635
[`apache::balancermember`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachebalancermember
37-
[`apache::fastcgi::server`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachefastcgiserver
3836
[`apache::mod`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachemod
3937
[`apache::mod::<MODULE NAME>`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#public-classes
4038
[`apache::mod::alias`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#apachemodalias
@@ -110,7 +108,6 @@
110108
[`ExtendedStatus`]: https://httpd.apache.org/docs/current/mod/core.html#extendedstatus
111109

112110
[Facter]: http://docs.puppet.com/facter/
113-
[FastCGI]: https://fast-cgi.github.io/
114111
[FallbackResource]: https://httpd.apache.org/docs/current/mod/mod_dir.html#fallbackresource
115112
[`fallbackresource`]: https://forge.puppet.com/modules/puppetlabs/apache/reference#fallbackresource
116113
[`FileETag`]: https://httpd.apache.org/docs/current/mod/core.html#fileetag
@@ -272,7 +269,6 @@
272269
- [Beginning with Apache - Installation][Beginning with Apache]
273270
3. [Usage - The classes and defined types available for configuration][Usage]
274271
- [Configuring virtual hosts - Examples to help get started][Configuring virtual hosts]
275-
- [Configuring FastCGI servers to handle PHP files][Configuring FastCGI servers]
276272
- [Load balancing with exported and non-exported resources][Load balancing examples]
277273
4. [Reference - An under-the-hood peek at what the module is doing and how][Reference]
278274
5. [Limitations - OS compatibility, etc.][Limitations]
@@ -316,7 +312,7 @@ When you declare this class with the default options, the module:
316312

317313
- Installs the appropriate Apache software package and [required Apache modules][`default_mods`] for your operating system.
318314
- 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.
315+
- Configures the server with a default virtual host and standard port (80) and address ('\*') bindings.
320316
- Creates a document root directory Depends on operating system, typically `/var/www`.
321317
- Starts the Apache service.
322318

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

346342
``` puppet
347343
apache::vhost { 'vhost.example.com':
348-
port => '80',
344+
port => 80,
349345
docroot => '/var/www/vhost',
350346
}
351347
```
@@ -358,7 +354,7 @@ To configure user and group ownership for `docroot`, use the [`docroot_owner`][]
358354

359355
``` puppet
360356
apache::vhost { 'user.example.com':
361-
port => '80',
357+
port => 80,
362358
docroot => '/var/www/user',
363359
docroot_owner => 'www-data',
364360
docroot_group => 'www-data',
@@ -367,11 +363,11 @@ apache::vhost { 'user.example.com':
367363

368364
#### Configuring virtual hosts with SSL
369365

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:
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:
371367

372368
``` puppet
373369
apache::vhost { 'ssl.example.com':
374-
port => '443',
370+
port => 443,
375371
docroot => '/var/www/ssl',
376372
ssl => true,
377373
}
@@ -381,7 +377,7 @@ To configure a virtual host to use SSL and specific SSL certificates, use the pa
381377

382378
``` puppet
383379
apache::vhost { 'cert.example.com':
384-
port => '443',
380+
port => 443,
385381
docroot => '/var/www/cert',
386382
ssl => true,
387383
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
395391
# The non-ssl virtual host
396392
apache::vhost { 'mix.example.com non-ssl':
397393
servername => 'mix.example.com',
398-
port => '80',
394+
port => 80,
399395
docroot => '/var/www/mix',
400396
}
401397
402398
# The SSL virtual host at the same domain
403399
apache::vhost { 'mix.example.com ssl':
404400
servername => 'mix.example.com',
405-
port => '443',
401+
port => 443,
406402
docroot => '/var/www/mix',
407403
ssl => true,
408404
}
@@ -413,15 +409,15 @@ To configure a virtual host to redirect unencrypted connections to SSL, declare
413409
``` puppet
414410
apache::vhost { 'redirect.example.com non-ssl':
415411
servername => 'redirect.example.com',
416-
port => '80',
412+
port => 80,
417413
docroot => '/var/www/redirect',
418414
redirect_status => 'permanent',
419415
redirect_dest => 'https://redirect.example.com/'
420416
}
421417
422418
apache::vhost { 'redirect.example.com ssl':
423419
servername => 'redirect.example.com',
424-
port => '443',
420+
port => 443,
425421
docroot => '/var/www/redirect',
426422
ssl => true,
427423
}
@@ -434,7 +430,7 @@ Virtual hosts listen on all IP addresses ('\*') by default. To configure the vir
434430
``` puppet
435431
apache::vhost { 'ip.example.com':
436432
ip => '127.0.0.1',
437-
port => '80',
433+
port => 80,
438434
docroot => '/var/www/ip',
439435
}
440436
```
@@ -444,7 +440,7 @@ You can also configure more than one IP address per virtual host by using an arr
444440
``` puppet
445441
apache::vhost { 'ip.example.com':
446442
ip => ['127.0.0.1','169.254.1.1'],
447-
port => '80',
443+
port => 80,
448444
docroot => '/var/www/ip',
449445
}
450446
```
@@ -454,7 +450,7 @@ You can configure multiple ports per virtual host by using an array of ports for
454450
``` puppet
455451
apache::vhost { 'ip.example.com':
456452
ip => ['127.0.0.1'],
457-
port => ['80','8080']
453+
port => [80, 8080]
458454
docroot => '/var/www/ip',
459455
}
460456
```
@@ -467,7 +463,7 @@ apache::vhost { 'aliases.example.com':
467463
'aliases.example.org',
468464
'aliases.example.net',
469465
],
470-
port => '80',
466+
port => 80,
471467
docroot => '/var/www/aliases',
472468
}
473469
```
@@ -477,7 +473,7 @@ To set up a virtual host with a wildcard alias for the subdomain mapped to a dir
477473
``` puppet
478474
apache::vhost { 'subdomain.loc':
479475
vhost_name => '*',
480-
port => '80',
476+
port => 80,
481477
virtual_docroot => '/var/www/%-2+',
482478
docroot => '/var/www',
483479
serveraliases => ['*.loc',],
@@ -488,7 +484,7 @@ To configure a virtual host with [filter rules][], pass the filter directives as
488484

489485
``` puppet
490486
apache::vhost { 'subdomain.loc':
491-
port => '80',
487+
port => 80,
492488
filters => [
493489
'FilterDeclare COMPRESS',
494490
'FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html',
@@ -505,13 +501,13 @@ To configure a virtual host to use the [Web Server Gateway Interface][] (WSGI) f
505501

506502
``` puppet
507503
apache::vhost { 'wsgi.example.com':
508-
port => '80',
504+
port => 80,
509505
docroot => '/var/www/pythonapp',
510506
wsgi_application_group => '%{GLOBAL}',
511507
wsgi_daemon_process => 'wsgi',
512508
wsgi_daemon_process_options => {
513-
processes => '2',
514-
threads => '15',
509+
processes => 2,
510+
threads => 15,
515511
display-name => '%{GROUP}',
516512
},
517513
wsgi_import_script => '/var/www/demo.wsgi',
@@ -528,7 +524,7 @@ As of Apache 2.2.16, Apache supports [FallbackResource][], a simple replacement
528524

529525
``` puppet
530526
apache::vhost { 'wordpress.example.com':
531-
port => '80',
527+
port => 80,
532528
docroot => '/var/www/wordpress',
533529
fallbackresource => '/index.php',
534530
}
@@ -540,7 +536,7 @@ To configure a virtual host with a designated directory for [Common Gateway Inte
540536

541537
``` puppet
542538
apache::vhost { 'cgi.example.com':
543-
port => '80',
539+
port => 80,
544540
docroot => '/var/www/cgi',
545541
scriptalias => '/usr/lib/cgi-bin',
546542
}
@@ -550,7 +546,7 @@ To configure a virtual host for [Rack][], use the [`rack_base_uri`][] parameter:
550546

551547
``` puppet
552548
apache::vhost { 'rack.example.com':
553-
port => '80',
549+
port => 80,
554550
docroot => '/var/www/rack',
555551
rack_base_uri => ['/rackapp1', '/rackapp2'],
556552
}
@@ -590,15 +586,15 @@ In this example, we add two IP-based virtual hosts on an IP address (in this exa
590586
apache::vhost { 'The first IP-based virtual host, non-ssl':
591587
servername => 'first.example.com',
592588
ip => '10.0.0.10',
593-
port => '80',
589+
port => 80,
594590
ip_based => true,
595591
docroot => '/var/www/first',
596592
}
597593
598594
apache::vhost { 'The first IP-based vhost, ssl':
599595
servername => 'first.example.com',
600596
ip => '10.0.0.10',
601-
port => '443',
597+
port => 443,
602598
ip_based => true,
603599
docroot => '/var/www/first-ssl',
604600
ssl => true,
@@ -610,13 +606,13 @@ Next, we add two name-based virtual hosts listening on a second IP address (10.0
610606
``` puppet
611607
apache::vhost { 'second.example.com':
612608
ip => '10.0.0.20',
613-
port => '80',
609+
port => 80,
614610
docroot => '/var/www/second',
615611
}
616612
617613
apache::vhost { 'third.example.com':
618614
ip => '10.0.0.20',
619-
port => '80',
615+
port => 80,
620616
docroot => '/var/www/third',
621617
}
622618
```
@@ -625,13 +621,13 @@ To add name-based virtual hosts that answer on either 10.0.0.10 or 10.0.0.20, yo
625621

626622
``` puppet
627623
apache::vhost { 'fourth.example.com':
628-
port => '80',
624+
port => 80,
629625
docroot => '/var/www/fourth',
630626
add_listen => false,
631627
}
632628
633629
apache::vhost { 'fifth.example.com':
634-
port => '80',
630+
port => 80,
635631
docroot => '/var/www/fifth',
636632
add_listen => false,
637633
}
@@ -676,54 +672,6 @@ apache::mod { 'mod_authnz_external': }
676672

677673
There are several optional parameters you can specify when defining Apache modules this way. See the [defined type's reference][`apache::mod`] for details.
678674

679-
<a id="configuring-fastcgi-servers-to-handle-php-files"></a>
680-
### Configuring FastCGI servers to handle PHP files
681-
682-
#### FastCGI on Ubuntu 18.04
683-
684-
On Ubuntu 18.04, `mod_fastcgi` is no longer supported. So considering:
685-
686-
* an Apache Vhost with docroot set to `/var/www/html`
687-
* a FastCGI server listening on `127.0.0.1:9000`
688-
689-
you can then use the [`custom_fragment`][] parameter to configure the virtual host to have the FastCGI server handle the specified file type:
690-
691-
``` puppet
692-
apache::vhost { 'www':
693-
...
694-
docroot => '/var/www/html/',
695-
custom_fragment => 'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/html/$1',
696-
...
697-
}
698-
```
699-
700-
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:
718-
719-
``` puppet
720-
apache::vhost { 'www':
721-
...
722-
custom_fragment => 'AddType application/x-httpd-php .php'
723-
...
724-
}
725-
```
726-
727675
<a id="load-balancing-examples"></a>
728676
### Load balancing examples
729677

0 commit comments

Comments
 (0)