Mercurial > repos > other > Puppet
comparison modules/apache/manifests/vhost.pp @ 275:d9352a684e62
Mass update of modules to remove deprecation warnings
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 26 Jan 2020 11:36:07 +0000 |
parents | 675c1cc61eaf |
children | b8d6ada284dd |
comparison
equal
deleted
inserted
replaced
274:b2571c28fc27 | 275:d9352a684e62 |
---|---|
1 # See README.md for usage information | 1 # @summary |
2 # Allows specialised configurations for virtual hosts that possess requirements | |
3 # outside of the defaults. | |
4 # | |
5 # The apache module allows a lot of flexibility in the setup and configuration of virtual hosts. | |
6 # This flexibility is due, in part, to `vhost` being a defined resource type, which allows Apache | |
7 # to evaluate it multiple times with different parameters.<br /> | |
8 # The `apache::vhost` defined type allows you to have specialized configurations for virtual hosts | |
9 # that have requirements outside the defaults. You can set up a default virtual host within | |
10 # the base `::apache` class, as well as set a customized virtual host as the default. | |
11 # Customized virtual hosts have a lower numeric `priority` than the base class's, causing | |
12 # Apache to process the customized virtual host first.<br /> | |
13 # The `apache::vhost` defined type uses `concat::fragment` to build the configuration file. To | |
14 # inject custom fragments for pieces of the configuration that the defined type doesn't | |
15 # inherently support, add a custom fragment.<br /> | |
16 # For the custom fragment's `order` parameter, the `apache::vhost` defined type uses multiples | |
17 # of 10, so any `order` that isn't a multiple of 10 should work.<br /> | |
18 # > **Note:** When creating an `apache::vhost`, it cannot be named `default` or `default-ssl`, | |
19 # because vhosts with these titles are always managed by the module. This means that you cannot | |
20 # override `Apache::Vhost['default']` or `Apache::Vhost['default-ssl]` resources. An optional | |
21 # workaround is to create a vhost named something else, such as `my default`, and ensure that the | |
22 # `default` and `default_ssl` vhosts are set to `false`: | |
23 # | |
24 # @example | |
25 # class { 'apache': | |
26 # default_vhost => false, | |
27 # default_ssl_vhost => false, | |
28 # } | |
29 # | |
30 # @param apache_version | |
31 # Apache's version number as a string, such as '2.2' or '2.4'. | |
32 # | |
33 # @param access_log | |
34 # Determines whether to configure `*_access.log` directives (`*_file`,`*_pipe`, or `*_syslog`). | |
35 # | |
36 # @param access_log_env_var | |
37 # Specifies that only requests with particular environment variables be logged. | |
38 # | |
39 # @param access_log_file | |
40 # Sets the filename of the `*_access.log` placed in `logroot`. Given a virtual host ---for | |
41 # instance, example.com--- it defaults to 'example.com_ssl.log' for | |
42 # [SSL-encrypted](https://httpd.apache.org/docs/current/ssl/index.html) virtual hosts and | |
43 # `example.com_access.log` for unencrypted virtual hosts. | |
44 # | |
45 # @param access_log_format | |
46 # Specifies the use of either a `LogFormat` nickname or a custom-formatted string for the | |
47 # access log. | |
48 # | |
49 # @param access_log_pipe | |
50 # Specifies a pipe where Apache sends access log messages. | |
51 # | |
52 # @param access_log_syslog | |
53 # Sends all access log messages to syslog. | |
54 # | |
55 # @param access_logs | |
56 # Allows you to give a hash that specifies the state of each of the `access_log_*` | |
57 # directives shown above, i.e. `access_log_pipe` and `access_log_syslog`. | |
58 # | |
59 # @param add_default_charset | |
60 # Sets a default media charset value for the `AddDefaultCharset` directive, which is | |
61 # added to `text/plain` and `text/html` responses. | |
62 # | |
63 # @param add_listen | |
64 # Determines whether the virtual host creates a `Listen` statement.<br /> | |
65 # Setting `add_listen` to `false` prevents the virtual host from creating a `Listen` | |
66 # statement. This is important when combining virtual hosts that aren't passed an `ip` | |
67 # parameter with those that are. | |
68 # | |
69 # @param use_optional_includes | |
70 # Specifies whether Apache uses the `IncludeOptional` directive instead of `Include` for | |
71 # `additional_includes` in Apache 2.4 or newer. | |
72 # | |
73 # @param additional_includes | |
74 # Specifies paths to additional static, virtual host-specific Apache configuration files. | |
75 # You can use this parameter to implement a unique, custom configuration not supported by | |
76 # this module. | |
77 # | |
78 # @param aliases | |
79 # Passes a list of [hashes][hash] to the virtual host to create `Alias`, `AliasMatch`, | |
80 # `ScriptAlias` or `ScriptAliasMatch` directives as per the `mod_alias` documentation.<br /> | |
81 # For example: | |
82 # ``` puppet | |
83 # aliases => [ | |
84 # { aliasmatch => '^/image/(.*)\.jpg$', | |
85 # path => '/files/jpg.images/$1.jpg', | |
86 # }, | |
87 # { alias => '/image', | |
88 # path => '/ftp/pub/image', | |
89 # }, | |
90 # { scriptaliasmatch => '^/cgi-bin(.*)', | |
91 # path => '/usr/local/share/cgi-bin$1', | |
92 # }, | |
93 # { scriptalias => '/nagios/cgi-bin/', | |
94 # path => '/usr/lib/nagios/cgi-bin/', | |
95 # }, | |
96 # { alias => '/nagios', | |
97 # path => '/usr/share/nagios/html', | |
98 # }, | |
99 # ], | |
100 # ``` | |
101 # For the `alias`, `aliasmatch`, `scriptalias` and `scriptaliasmatch` keys to work, each needs | |
102 # a corresponding context, such as `<Directory /path/to/directory>` or | |
103 # `<Location /some/location/here>`. Puppet creates the directives in the order specified in | |
104 # the `aliases` parameter. As described in the `mod_alias` documentation, add more specific | |
105 # `alias`, `aliasmatch`, `scriptalias` or `scriptaliasmatch` parameters before the more | |
106 # general ones to avoid shadowing.<BR /> | |
107 # > **Note**: Use the `aliases` parameter instead of the `scriptaliases` parameter because | |
108 # you can precisely control the order of various alias directives. Defining `ScriptAliases` | |
109 # using the `scriptaliases` parameter means *all* `ScriptAlias` directives will come after | |
110 # *all* `Alias` directives, which can lead to `Alias` directives shadowing `ScriptAlias` | |
111 # directives. This often causes problems; for example, this could cause problems with Nagios.<BR /> | |
112 # If `apache::mod::passenger` is loaded and `PassengerHighPerformance` is `true`, the `Alias` | |
113 # directive might not be able to honor the `PassengerEnabled => off` statement. See | |
114 # [this article](http://www.conandalton.net/2010/06/passengerenabled-off-not-working.html) for details. | |
115 # | |
116 # @param allow_encoded_slashes | |
117 # Sets the `AllowEncodedSlashes` declaration for the virtual host, overriding the server | |
118 # default. This modifies the virtual host responses to URLs with `\` and `/` characters. The | |
119 # default setting omits the declaration from the server configuration and selects the | |
120 # Apache default setting of `Off`. | |
121 # | |
122 # @param block | |
123 # Specifies the list of things to which Apache blocks access. Valid options are: `scm` (which | |
124 # blocks web access to `.svn`), `.git`, and `.bzr` directories. | |
125 # | |
126 # @param cas_attribute_prefix | |
127 # Adds a header with the value of this header being the attribute values when SAML | |
128 # validation is enabled. | |
129 # | |
130 # @param cas_attribute_delimiter | |
131 # Sets the delimiter between attribute values in the header created by `cas_attribute_prefix`. | |
132 # | |
133 # @param cas_login_url | |
134 # Sets the URL to which the module redirects users when they attempt to access a | |
135 # CAS-protected resource and don't have an active session. | |
136 # | |
137 # @param cas_root_proxied_as | |
138 # Sets the URL end users see when access to this Apache server is proxied per vhost. | |
139 # This URL should not include a trailing slash. | |
140 # | |
141 # @param cas_scrub_request_headers | |
142 # Remove inbound request headers that may have special meaning within mod_auth_cas. | |
143 # | |
144 # @param cas_sso_enabled | |
145 # Enables experimental support for single sign out (may mangle POST data). | |
146 # | |
147 # @param cas_validate_saml | |
148 # Parse response from CAS server for SAML. | |
149 # | |
150 # @param cas_validate_url | |
151 # Sets the URL to use when validating a client-presented ticket in an HTTP query string. | |
152 # | |
153 # @param comment | |
154 # Adds comments to the header of the configuration file. Pass as string or an array of strings. | |
155 # For example: | |
156 # ``` puppet | |
157 # comment => "Account number: 123B", | |
158 # ``` | |
159 # Or: | |
160 # ``` puppet | |
161 # comment => [ | |
162 # "Customer: X", | |
163 # "Frontend domain: x.example.org", | |
164 # ] | |
165 # ``` | |
166 # | |
167 # @param custom_fragment | |
168 # Passes a string of custom configuration directives to place at the end of the virtual | |
169 # host configuration. | |
170 # | |
171 # @param default_vhost | |
172 # Sets a given `apache::vhost` defined type as the default to serve requests that do not | |
173 # match any other `apache::vhost` defined types. | |
174 # | |
175 # @param directoryindex | |
176 # Sets the list of resources to look for when a client requests an index of the directory | |
177 # by specifying a '/' at the end of the directory name. See the `DirectoryIndex` directive | |
178 # documentation for details. | |
179 # | |
180 # @param docroot | |
181 # **Required**.<br /> | |
182 # Sets the `DocumentRoot` location, from which Apache serves files.<br /> | |
183 # If `docroot` and `manage_docroot` are both set to `false`, no `DocumentRoot` will be set | |
184 # and the accompanying `<Directory /path/to/directory>` block will not be created. | |
185 # | |
186 # @param docroot_group | |
187 # Sets group access to the `docroot` directory. | |
188 # | |
189 # @param docroot_owner | |
190 # Sets individual user access to the `docroot` directory. | |
191 # | |
192 # @param docroot_mode | |
193 # Sets access permissions for the `docroot` directory, in numeric notation. | |
194 # | |
195 # @param manage_docroot | |
196 # Determines whether Puppet manages the `docroot` directory. | |
197 # | |
198 # @param error_log | |
199 # Specifies whether `*_error.log` directives should be configured. | |
200 # | |
201 # @param error_log_file | |
202 # Points the virtual host's error logs to a `*_error.log` file. If this parameter is | |
203 # undefined, Puppet checks for values in `error_log_pipe`, then `error_log_syslog`.<br /> | |
204 # If none of these parameters is set, given a virtual host `example.com`, Puppet defaults | |
205 # to `$logroot/example.com_error_ssl.log` for SSL virtual hosts and | |
206 # `$logroot/example.com_error.log` for non-SSL virtual hosts. | |
207 # | |
208 # @param error_log_pipe | |
209 # Specifies a pipe to send error log messages to.<br /> | |
210 # This parameter has no effect if the `error_log_file` parameter has a value. If neither | |
211 # this parameter nor `error_log_file` has a value, Puppet then checks `error_log_syslog`. | |
212 # | |
213 # @param error_log_syslog | |
214 # Determines whether to send all error log messages to syslog. | |
215 # This parameter has no effect if either of the `error_log_file` or `error_log_pipe` | |
216 # parameters has a value. If none of these parameters has a value, given a virtual host | |
217 # `example.com`, Puppet defaults to `$logroot/example.com_error_ssl.log` for SSL virtual | |
218 # hosts and `$logroot/example.com_error.log` for non-SSL virtual hosts. | |
219 # | |
220 # @param error_documents | |
221 # A list of hashes which can be used to override the | |
222 # [ErrorDocument](https://httpd.apache.org/docs/current/mod/core.html#errordocument) | |
223 # settings for this virtual host.<br /> | |
224 # For example: | |
225 # ``` puppet | |
226 # apache::vhost { 'sample.example.net': | |
227 # error_documents => [ | |
228 # { 'error_code' => '503', 'document' => '/service-unavail' }, | |
229 # { 'error_code' => '407', 'document' => 'https://example.com/proxy/login' }, | |
230 # ], | |
231 # } | |
232 # ``` | |
233 # | |
234 # @param ensure | |
235 # Specifies if the virtual host is present or absent.<br /> | |
236 # | |
237 # @param fallbackresource | |
238 # Sets the [FallbackResource](https://httpd.apache.org/docs/current/mod/mod_dir.html#fallbackresource) | |
239 # directive, which specifies an action to take for any URL that doesn't map to anything in | |
240 # your filesystem and would otherwise return 'HTTP 404 (Not Found)'. Values must either begin | |
241 # with a `/` or be `disabled`. | |
242 # | |
243 # @param fastcgi_server | |
244 # Specify an external FastCGI server to manage a connection to. | |
245 # | |
246 # @param fastcgi_socket | |
247 # Specify the socket that will be used to communicate with an external FastCGI server. | |
248 # | |
249 # @param fastcgi_idle_timeout | |
250 # If using fastcgi, this option sets the timeout for the server to respond. | |
251 # | |
252 # @param fastcgi_dir | |
253 # Specify an internal FastCGI directory that is to be managed. | |
254 # | |
255 # @param filters | |
256 # [Filters](https://httpd.apache.org/docs/current/mod/mod_filter.html) enable smart, | |
257 # context-sensitive configuration of output content filters. | |
258 # ``` puppet | |
259 # apache::vhost { "$::fqdn": | |
260 # filters => [ | |
261 # 'FilterDeclare COMPRESS', | |
262 # 'FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html', | |
263 # 'FilterChain COMPRESS', | |
264 # 'FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no', | |
265 # ], | |
266 # } | |
267 # ``` | |
268 # | |
269 # @param h2_copy_files | |
270 # Sets the [H2CopyFiles](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2copyfiles) | |
271 # directive which influences how the requestion process pass files to the main connection. | |
272 # | |
273 # @param h2_direct | |
274 # Sets the [H2Direct](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2direct) | |
275 # directive which toggles the usage of the HTTP/2 Direct Mode. | |
276 # | |
277 # @param h2_early_hints | |
278 # Sets the [H2EarlyHints](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2earlyhints) | |
279 # directive which controls if HTTP status 103 interim responses are forwarded to | |
280 # the client or not. | |
281 # | |
282 # @param h2_max_session_streams | |
283 # Sets the [H2MaxSessionStreams](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2maxsessionstreams) | |
284 # directive which sets the maximum number of active streams per HTTP/2 session | |
285 # that the server allows. | |
286 # | |
287 # @param h2_modern_tls_only | |
288 # Sets the [H2ModernTLSOnly](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2moderntlsonly) | |
289 # directive which toggles the security checks on HTTP/2 connections in TLS mode. | |
290 # | |
291 # @param h2_push | |
292 # Sets the [H2Push](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2push) | |
293 # directive which toggles the usage of the HTTP/2 server push protocol feature. | |
294 # | |
295 # @param h2_push_diary_size | |
296 # Sets the [H2PushDiarySize](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2pushdiarysize) | |
297 # directive which toggles the maximum number of HTTP/2 server pushes that are | |
298 # remembered per HTTP/2 connection. | |
299 # | |
300 # @param h2_push_priority | |
301 # Sets the [H2PushPriority](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2pushpriority) | |
302 # directive which defines the priority handling of pushed responses based on the | |
303 # content-type of the response. | |
304 # | |
305 # @param h2_push_resource | |
306 # Sets the [H2PushResource](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2pushresource) | |
307 # directive which declares resources for early pushing to the client. | |
308 # | |
309 # @param h2_serialize_headers | |
310 # Sets the [H2SerializeHeaders](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2serializeheaders) | |
311 # directive which toggles if HTTP/2 requests are serialized in HTTP/1.1 | |
312 # format for processing by httpd core. | |
313 # | |
314 # @param h2_stream_max_mem_size | |
315 # Sets the [H2StreamMaxMemSize](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2streammaxmemsize) | |
316 # directive which sets the maximum number of outgoing data bytes buffered in | |
317 # memory for an active stream. | |
318 # | |
319 # @param h2_tls_cool_down_secs | |
320 # Sets the [H2TLSCoolDownSecs](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2tlscooldownsecs) | |
321 # directive which sets the number of seconds of idle time on a TLS connection | |
322 # before the TLS write size falls back to a small (~1300 bytes) length. | |
323 # | |
324 # @param h2_tls_warm_up_size | |
325 # Sets the [H2TLSWarmUpSize](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2tlswarmupsize) | |
326 # directive which sets the number of bytes to be sent in small TLS records (~1300 | |
327 # bytes) until doing maximum sized writes (16k) on https: HTTP/2 connections. | |
328 # | |
329 # @param h2_upgrade | |
330 # Sets the [H2Upgrade](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2upgrade) | |
331 # directive which toggles the usage of the HTTP/1.1 Upgrade method for switching | |
332 # to HTTP/2. | |
333 # | |
334 # @param h2_window_size | |
335 # Sets the [H2WindowSize](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2windowsize) | |
336 # directive which sets the size of the window that is used for flow control from | |
337 # client to server and limits the amount of data the server has to buffer. | |
338 # | |
339 # @param headers | |
340 # Adds lines to replace, merge, or remove response headers. See | |
341 # [Apache's mod_headers documentation](https://httpd.apache.org/docs/current/mod/mod_headers.html#header) for more information. | |
342 # | |
343 # @param ip | |
344 # Sets the IP address the virtual host listens on. By default, uses Apache's default behavior | |
345 # of listening on all IPs. | |
346 # | |
347 # @param ip_based | |
348 # Enables an [IP-based](https://httpd.apache.org/docs/current/vhosts/ip-based.html) virtual | |
349 # host. This parameter inhibits the creation of a NameVirtualHost directive, since those are | |
350 # used to funnel requests to name-based virtual hosts. | |
351 # | |
352 # @param itk | |
353 # Configures [ITK](http://mpm-itk.sesse.net/) in a hash.<br /> | |
354 # Usage typically looks something like: | |
355 # ``` puppet | |
356 # apache::vhost { 'sample.example.net': | |
357 # docroot => '/path/to/directory', | |
358 # itk => { | |
359 # user => 'someuser', | |
360 # group => 'somegroup', | |
361 # }, | |
362 # } | |
363 # ``` | |
364 # Valid values are: a hash, which can include the keys: | |
365 # * `user` + `group` | |
366 # * `assignuseridexpr` | |
367 # * `assigngroupidexpr` | |
368 # * `maxclientvhost` | |
369 # * `nice` | |
370 # * `limituidrange` (Linux 3.5.0 or newer) | |
371 # * `limitgidrange` (Linux 3.5.0 or newer) | |
372 # | |
373 # @param action | |
374 # Specifies whether you wish to configure mod_actions action directive which will | |
375 # activate cgi-script when triggered by a request. | |
376 # | |
377 # @param jk_mounts | |
378 # Sets up a virtual host with `JkMount` and `JkUnMount` directives to handle the paths | |
379 # for URL mapping between Tomcat and Apache.<br /> | |
380 # The parameter must be an array of hashes where each hash must contain the `worker` | |
381 # and either the `mount` or `unmount` keys.<br /> | |
382 # Usage typically looks like: | |
383 # ``` puppet | |
384 # apache::vhost { 'sample.example.net': | |
385 # jk_mounts => [ | |
386 # { mount => '/*', worker => 'tcnode1', }, | |
387 # { unmount => '/*.jpg', worker => 'tcnode1', }, | |
388 # ], | |
389 # } | |
390 # ``` | |
391 # | |
392 # @param http_protocol_options | |
393 # Specifies the strictness of HTTP protocol checks. | |
394 # | |
395 # @param keepalive | |
396 # Determines whether to enable persistent HTTP connections with the `KeepAlive` directive | |
397 # for the virtual host. By default, the global, server-wide `KeepAlive` setting is in effect.<br /> | |
398 # Use the `keepalive_timeout` and `max_keepalive_requests` parameters to set relevant options | |
399 # for the virtual host. | |
400 # | |
401 # @param keepalive_timeout | |
402 # Sets the `KeepAliveTimeout` directive for the virtual host, which determines the amount | |
403 # of time to wait for subsequent requests on a persistent HTTP connection. By default, the | |
404 # global, server-wide `KeepAlive` setting is in effect.<br /> | |
405 # This parameter is only relevant if either the global, server-wide `keepalive` parameter or | |
406 # the per-vhost `keepalive` parameter is enabled. | |
407 # | |
408 # @param max_keepalive_requests | |
409 # Limits the number of requests allowed per connection to the virtual host. By default, | |
410 # the global, server-wide `KeepAlive` setting is in effect.<br /> | |
411 # This parameter is only relevant if either the global, server-wide `keepalive` parameter or | |
412 # the per-vhost `keepalive` parameter is enabled. | |
413 # | |
414 # @param auth_kerb | |
415 # Enable `mod_auth_kerb` parameters for a virtual host.<br /> | |
416 # Usage typically looks like: | |
417 # ``` puppet | |
418 # apache::vhost { 'sample.example.net': | |
419 # auth_kerb => `true`, | |
420 # krb_method_negotiate => 'on', | |
421 # krb_auth_realms => ['EXAMPLE.ORG'], | |
422 # krb_local_user_mapping => 'on', | |
423 # directories => { | |
424 # path => '/var/www/html', | |
425 # auth_name => 'Kerberos Login', | |
426 # auth_type => 'Kerberos', | |
427 # auth_require => 'valid-user', | |
428 # }, | |
429 # } | |
430 # ``` | |
431 # | |
432 # @param krb_method_negotiate | |
433 # Determines whether to use the Negotiate method. | |
434 # | |
435 # @param krb_method_k5passwd | |
436 # Determines whether to use password-based authentication for Kerberos v5. | |
437 # | |
438 # @param krb_authoritative | |
439 # If set to `off`, authentication controls can be passed on to another module. | |
440 # | |
441 # @param krb_auth_realms | |
442 # Specifies an array of Kerberos realms to use for authentication. | |
443 # | |
444 # @param krb_5keytab | |
445 # Specifies the Kerberos v5 keytab file's location. | |
446 # | |
447 # @param krb_local_user_mapping | |
448 # Strips @REALM from usernames for further use. | |
449 # | |
450 # @param krb_verify_kdc | |
451 # This option can be used to disable the verification tickets against local keytab to prevent | |
452 # KDC spoofing attacks. | |
453 # | |
454 # @param krb_servicename | |
455 # Specifies the service name that will be used by Apache for authentication. Corresponding | |
456 # key of this name must be stored in the keytab. | |
457 # | |
458 # @param krb_save_credentials | |
459 # This option enables credential saving functionality. | |
460 # | |
461 # @param logroot | |
462 # Specifies the location of the virtual host's logfiles. | |
463 # | |
464 # @param logroot_ensure | |
465 # Determines whether or not to remove the logroot directory for a virtual host. | |
466 # | |
467 # @param logroot_mode | |
468 # Overrides the mode the logroot directory is set to. Do *not* grant write access to the | |
469 # directory the logs are stored in without being aware of the consequences; for more | |
470 # information, see [Apache's log security documentation](https://httpd.apache.org/docs/2.4/logs.html#security). | |
471 # | |
472 # @param logroot_owner | |
473 # Sets individual user access to the logroot directory. | |
474 # | |
475 # @param logroot_group | |
476 # Sets group access to the `logroot` directory. | |
477 # | |
478 # @param log_level | |
479 # Specifies the verbosity of the error log. | |
480 # | |
481 # @param modsec_body_limit | |
482 # Configures the maximum request body size (in bytes) ModSecurity accepts for buffering. | |
483 # | |
484 # @param modsec_disable_vhost | |
485 # Disables `mod_security` on a virtual host. Only valid if `apache::mod::security` is included. | |
486 # | |
487 # @param modsec_disable_ids | |
488 # Removes `mod_security` IDs from the virtual host.<br /> | |
489 # Also takes a hash allowing removal of an ID from a specific location. | |
490 # ``` puppet | |
491 # apache::vhost { 'sample.example.net': | |
492 # modsec_disable_ids => [ 90015, 90016 ], | |
493 # } | |
494 # ``` | |
495 # | |
496 # ``` puppet | |
497 # apache::vhost { 'sample.example.net': | |
498 # modsec_disable_ids => { '/location1' => [ 90015, 90016 ] }, | |
499 # } | |
500 # ``` | |
501 # | |
502 # @param modsec_disable_ips | |
503 # Specifies an array of IP addresses to exclude from `mod_security` rule matching. | |
504 # | |
505 # @param modsec_disable_msgs | |
506 # Array of mod_security Msgs to remove from the virtual host. Also takes a hash allowing | |
507 # removal of an Msg from a specific location. | |
508 # ``` puppet | |
509 # apache::vhost { 'sample.example.net': | |
510 # modsec_disable_msgs => ['Blind SQL Injection Attack', 'Session Fixation Attack'], | |
511 # } | |
512 # ``` | |
513 # ``` puppet | |
514 # apache::vhost { 'sample.example.net': | |
515 # modsec_disable_msgs => { '/location1' => ['Blind SQL Injection Attack', 'Session Fixation Attack'] }, | |
516 # } | |
517 # ``` | |
518 # | |
519 # @param modsec_disable_tags | |
520 # Array of mod_security Tags to remove from the virtual host. Also takes a hash allowing | |
521 # removal of an Tag from a specific location. | |
522 # ``` puppet | |
523 # apache::vhost { 'sample.example.net': | |
524 # modsec_disable_tags => ['WEB_ATTACK/SQL_INJECTION', 'WEB_ATTACK/XSS'], | |
525 # } | |
526 # ``` | |
527 # ``` puppet | |
528 # apache::vhost { 'sample.example.net': | |
529 # modsec_disable_tags => { '/location1' => ['WEB_ATTACK/SQL_INJECTION', 'WEB_ATTACK/XSS'] }, | |
530 # } | |
531 # ``` | |
532 # | |
533 # @param modsec_audit_log_file | |
534 # If set, it is relative to `logroot`.<br /> | |
535 # One of the parameters that determines how to send `mod_security` audit | |
536 # log ([SecAuditLog](https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#SecAuditLog)). | |
537 # If none of those parameters are set, the global audit log is used | |
538 # (`/var/log/httpd/modsec\_audit.log`; Debian and derivatives: `/var/log/apache2/modsec\_audit.log`; others: ). | |
539 # | |
540 # @param modsec_audit_log_pipe | |
541 # If `modsec_audit_log_pipe` is set, it should start with a pipe. Example | |
542 # `|/path/to/mlogc /path/to/mlogc.conf`.<br /> | |
543 # One of the parameters that determines how to send `mod_security` audit | |
544 # log ([SecAuditLog](https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#SecAuditLog)). | |
545 # If none of those parameters are set, the global audit log is used | |
546 # (`/var/log/httpd/modsec\_audit.log`; Debian and derivatives: `/var/log/apache2/modsec\_audit.log`; others: ). | |
547 # | |
548 # @param modsec_audit_log | |
549 # If `modsec_audit_log` is `true`, given a virtual host ---for instance, example.com--- it | |
550 # defaults to `example.com\_security\_ssl.log` for SSL-encrypted virtual hosts | |
551 # and `example.com\_security.log` for unencrypted virtual hosts.<br /> | |
552 # One of the parameters that determines how to send `mod_security` audit | |
553 # log ([SecAuditLog](https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#SecAuditLog)).<br /> | |
554 # If none of those parameters are set, the global audit log is used | |
555 # (`/var/log/httpd/modsec\_audit.log`; Debian and derivatives: `/var/log/apache2/modsec\_audit.log`; others: ). | |
556 # | |
557 # @param no_proxy_uris | |
558 # Specifies URLs you do not want to proxy. This parameter is meant to be used in combination | |
559 # with [`proxy_dest`](#proxy_dest). | |
560 # | |
561 # @param no_proxy_uris_match | |
562 # This directive is equivalent to `no_proxy_uris`, but takes regular expressions. | |
563 # | |
564 # @param proxy_preserve_host | |
565 # Sets the [ProxyPreserveHost Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypreservehost).<br /> | |
566 # Setting this parameter to `true` enables the `Host:` line from an incoming request to be | |
567 # proxied to the host instead of hostname. Setting it to `false` sets this directive to 'Off'. | |
568 # | |
569 # @param proxy_add_headers | |
570 # Sets the [ProxyAddHeaders Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyaddheaders).<br /> | |
571 # This parameter controlls whether proxy-related HTTP headers (X-Forwarded-For, | |
572 # X-Forwarded-Host and X-Forwarded-Server) get sent to the backend server. | |
573 # | |
574 # @param proxy_error_override | |
575 # Sets the [ProxyErrorOverride Directive](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxyerroroverride). | |
576 # This directive controls whether Apache should override error pages for proxied content. | |
577 # | |
578 # @param options | |
579 # Sets the `Options` for the specified virtual host. For example: | |
580 # ``` puppet | |
581 # apache::vhost { 'site.name.fdqn': | |
582 # … | |
583 # options => ['Indexes','FollowSymLinks','MultiViews'], | |
584 # } | |
585 # ``` | |
586 # > **Note**: If you use the `directories` parameter of `apache::vhost`, 'Options', | |
587 # 'Override', and 'DirectoryIndex' are ignored because they are parameters within `directories`. | |
588 # | |
589 # @param override | |
590 # Sets the overrides for the specified virtual host. Accepts an array of | |
591 # [AllowOverride](https://httpd.apache.org/docs/current/mod/core.html#allowoverride) arguments. | |
592 # | |
593 # @param passenger_enabled | |
594 # Sets the value for the [PassengerEnabled](http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerEnabled) | |
595 # directive to `on` or `off`. Requires `apache::mod::passenger` to be included. | |
596 # ``` puppet | |
597 # apache::vhost { 'sample.example.net': | |
598 # docroot => '/path/to/directory', | |
599 # directories => [ | |
600 # { path => '/path/to/directory', | |
601 # passenger_enabled => 'on', | |
602 # }, | |
603 # ], | |
604 # } | |
605 # ``` | |
606 # > **Note:** There is an [issue](http://www.conandalton.net/2010/06/passengerenabled-off-not-working.html) | |
607 # using the PassengerEnabled directive with the PassengerHighPerformance directive. | |
608 # | |
609 # @param passenger_base_uri | |
610 # Sets [PassengerBaseURI](https://www.phusionpassenger.com/library/config/apache/reference/#passengerbase_rui), | |
611 # to specify that the given URI is a distinct application served by Passenger. | |
612 # | |
613 # @param passenger_ruby | |
614 # Sets [PassengerRuby](https://www.phusionpassenger.com/library/config/apache/reference/#passengerruby), | |
615 # specifying the Ruby interpreter to use when serving the relevant web applications. | |
616 # | |
617 # @param passenger_python | |
618 # Sets [PassengerPython](https://www.phusionpassenger.com/library/config/apache/reference/#passengerpython), | |
619 # specifying the Python interpreter to use when serving the relevant web applications. | |
620 # | |
621 # @param passenger_nodejs | |
622 # Sets the [`PassengerNodejs`](https://www.phusionpassenger.com/library/config/apache/reference/#passengernodejs), | |
623 # specifying Node.js command to use when serving the relevant web applications. | |
624 # | |
625 # @param passenger_meteor_app_settings | |
626 # Sets [PassengerMeteorAppSettings](https://www.phusionpassenger.com/library/config/apache/reference/#passengermeteorappsettings), | |
627 # specifying a JSON file with settings for the application when using a Meteor | |
628 # application in non-bundled mode. | |
629 # | |
630 # @param passenger_app_env | |
631 # Sets [PassengerAppEnv](https://www.phusionpassenger.com/library/config/apache/reference/#passengerappenv), | |
632 # the environment for the Passenger application. If not specified, defaults to the global | |
633 # setting or 'production'. | |
634 # | |
635 # @param passenger_app_root | |
636 # Sets [PassengerRoot](https://www.phusionpassenger.com/library/config/apache/reference/#passengerapproot), | |
637 # the location of the Passenger application root if different from the DocumentRoot. | |
638 # | |
639 # @param passenger_app_group_name | |
640 # Sets [PassengerAppGroupName](https://www.phusionpassenger.com/library/config/apache/reference/#passengerappgroupname), | |
641 # the name of the application group that the current application should belong to. | |
642 # | |
643 # @param passenger_app_type | |
644 # Sets [PassengerAppType](https://www.phusionpassenger.com/library/config/apache/reference/#passengerapptype), | |
645 # to force Passenger to recognize the application as a specific type. | |
646 # | |
647 # @param passenger_startup_file | |
648 # Sets the [PassengerStartupFile](https://www.phusionpassenger.com/library/config/apache/reference/#passengerstartupfile) | |
649 # path. This path is relative to the application root. | |
650 # | |
651 # @param passenger_restart_dir | |
652 # Sets the [PassengerRestartDir](https://www.phusionpassenger.com/library/config/apache/reference/#passengerrestartdir) | |
653 # to customize the directory in which `restart.txt` is searched for. | |
654 # | |
655 # @param passenger_spawn_method | |
656 # Sets [PassengerSpawnMethod](https://www.phusionpassenger.com/library/config/apache/reference/#passengerspawnmethod), | |
657 # whether Passenger spawns applications directly, or using a prefork copy-on-write mechanism. | |
658 # | |
659 # @param passenger_load_shell_envvars | |
660 # Sets [PassengerLoadShellEnvvars](https://www.phusionpassenger.com/library/config/apache/reference/#passengerloadshellenvvars), | |
661 # to enable or disable the loading of shell environment variables before spawning the application. | |
662 # | |
663 # @param passenger_rolling_restarts | |
664 # Sets [PassengerRollingRestarts](https://www.phusionpassenger.com/library/config/apache/reference/#passengerrollingrestarts), | |
665 # to enable or disable support for zero-downtime application restarts through `restart.txt`. | |
666 # | |
667 # @param passenger_resist_deployment_errors | |
668 # Sets [PassengerResistDeploymentErrors](https://www.phusionpassenger.com/library/config/apache/reference/#passengerresistdeploymenterrors), | |
669 # to enable or disable resistance against deployment errors. | |
670 # | |
671 # @param passenger_user | |
672 # Sets [PassengerUser](https://www.phusionpassenger.com/library/config/apache/reference/#passengeruser), | |
673 # the running user for sandboxing applications. | |
674 # | |
675 # @param passenger_group | |
676 # Sets [PassengerGroup](https://www.phusionpassenger.com/library/config/apache/reference/#passengergroup), | |
677 # the running group for sandboxing applications. | |
678 # | |
679 # @param passenger_friendly_error_pages | |
680 # Sets [PassengerFriendlyErrorPages](https://www.phusionpassenger.com/library/config/apache/reference/#passengerfriendlyerrorpages), | |
681 # which can display friendly error pages whenever an application fails to start. This | |
682 # friendly error page presents the startup error message, some suggestions for solving | |
683 # the problem, a backtrace and a dump of the environment variables. | |
684 # | |
685 # @param passenger_min_instances | |
686 # Sets [PassengerMinInstances](https://www.phusionpassenger.com/library/config/apache/reference/#passengermininstances), | |
687 # the minimum number of application processes to run. | |
688 # | |
689 # @param passenger_max_instances | |
690 # Sets [PassengerMaxInstances](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxinstances), | |
691 # the maximum number of application processes to run. | |
692 # | |
693 # @param passenger_max_preloader_idle_time | |
694 # Sets [PassengerMaxPreloaderIdleTime](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxpreloaderidletime), | |
695 # the maximum amount of time the preloader waits before shutting down an idle process. | |
696 # | |
697 # @param passenger_force_max_concurrent_requests_per_process | |
698 # Sets [PassengerForceMaxConcurrentRequestsPerProcess](https://www.phusionpassenger.com/library/config/apache/reference/#passengerforcemaxconcurrentrequestsperprocess), | |
699 # the maximum amount of concurrent requests the application can handle per process. | |
700 # | |
701 # @param passenger_start_timeout | |
702 # Sets [PassengerStartTimeout](https://www.phusionpassenger.com/library/config/apache/reference/#passengerstarttimeout), | |
703 # the timeout for the application startup. | |
704 # | |
705 # @param passenger_concurrency_model | |
706 # Sets [PassengerConcurrencyModel](https://www.phusionpassenger.com/library/config/apache/reference/#passengerconcurrencyodel), | |
707 # to specify the I/O concurrency model that should be used for Ruby application processes. | |
708 # Passenger supports two concurrency models:<br /> | |
709 # * `process` – single-threaded, multi-processed I/O concurrency. | |
710 # * `thread` – multi-threaded, multi-processed I/O concurrency. | |
711 # | |
712 # @param passenger_thread_count | |
713 # Sets [PassengerThreadCount](https://www.phusionpassenger.com/library/config/apache/reference/#passengerthreadcount), | |
714 # the number of threads that Passenger should spawn per Ruby application process.<br /> | |
715 # This option only has effect if PassengerConcurrencyModel is `thread`. | |
716 # | |
717 # @param passenger_max_requests | |
718 # Sets [PassengerMaxRequests](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequests), | |
719 # the maximum number of requests an application process will process. | |
720 # | |
721 # @param passenger_max_request_time | |
722 # Sets [PassengerMaxRequestTime](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequesttime), | |
723 # the maximum amount of time, in seconds, that an application process may take to | |
724 # process a request. | |
725 # | |
726 # @param passenger_memory_limit | |
727 # Sets [PassengerMemoryLimit](https://www.phusionpassenger.com/library/config/apache/reference/#passengermemorylimit), | |
728 # the maximum amount of memory that an application process may use, in megabytes. | |
729 # | |
730 # @param passenger_stat_throttle_rate | |
731 # Sets [PassengerStatThrottleRate](https://www.phusionpassenger.com/library/config/apache/reference/#passengerstatthrottlerate), | |
732 # to set a limit, in seconds, on how often Passenger will perform it's filesystem checks. | |
733 # | |
734 # @param passenger_pre_start | |
735 # Sets [PassengerPreStart](https://www.phusionpassenger.com/library/config/apache/reference/#passengerprestart), | |
736 # the URL of the application if pre-starting is required. | |
737 # | |
738 # @param passenger_high_performance | |
739 # Sets [PassengerHighPerformance](https://www.phusionpassenger.com/library/config/apache/reference/#passengerhighperformance), | |
740 # to enhance performance in return for reduced compatibility. | |
741 # | |
742 # @param passenger_buffer_upload | |
743 # Sets [PassengerBufferUpload](https://www.phusionpassenger.com/library/config/apache/reference/#passengerbufferupload), | |
744 # to buffer HTTP client request bodies before they are sent to the application. | |
745 # | |
746 # @param passenger_buffer_response | |
747 # Sets [PassengerBufferResponse](https://www.phusionpassenger.com/library/config/apache/reference/#passengerbufferresponse), | |
748 # to buffer Happlication-generated responses. | |
749 # | |
750 # @param passenger_error_override | |
751 # Sets [PassengerErrorOverride](https://www.phusionpassenger.com/library/config/apache/reference/#passengererroroverride), | |
752 # to specify whether Apache will intercept and handle response with HTTP status codes of | |
753 # 400 and higher. | |
754 # | |
755 # @param passenger_max_request_queue_size | |
756 # Sets [PassengerMaxRequestQueueSize](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequestqueuesize), | |
757 # to specify the maximum amount of requests that are allowed to queue whenever the maximum | |
758 # concurrent request limit is reached. If the queue is already at this specified limit, then | |
759 # Passenger immediately sends a "503 Service Unavailable" error to any incoming requests.<br /> | |
760 # A value of 0 means that the queue size is unbounded. | |
761 # | |
762 # @param passenger_max_request_queue_time | |
763 # Sets [PassengerMaxRequestQueueTime](https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequestqueuetime), | |
764 # to specify the maximum amount of time that requests are allowed to stay in the queue | |
765 # whenever the maximum concurrent request limit is reached. If a request reaches this specified | |
766 # limit, then Passenger immeaditly sends a "504 Gateway Timeout" error for that request.<br /> | |
767 # A value of 0 means that the queue time is unbounded. | |
768 # | |
769 # @param passenger_sticky_sessions | |
770 # Sets [PassengerStickySessions](https://www.phusionpassenger.com/library/config/apache/reference/#passengerstickysessions), | |
771 # to specify that, whenever possible, all requests sent by a client will be routed to the same | |
772 # originating application process. | |
773 # | |
774 # @param passenger_sticky_sessions_cookie_name | |
775 # Sets [PassengerStickySessionsCookieName](https://www.phusionpassenger.com/library/config/apache/reference/#passengerstickysessionscookiename), | |
776 # to specify the name of the sticky sessions cookie. | |
777 # | |
778 # @param passenger_allow_encoded_slashes | |
779 # Sets [PassengerAllowEncodedSlashes](https://www.phusionpassenger.com/library/config/apache/reference/#passengerallowencodedslashes), | |
780 # to allow URLs with encoded slashes. Please note that this feature will not work properly | |
781 # unless Apache's `AllowEncodedSlashes` is also enabled. | |
782 # | |
783 # @param passenger_debugger | |
784 # Sets [PassengerDebugger](https://www.phusionpassenger.com/library/config/apache/reference/#passengerdebugger), | |
785 # to turn support for Ruby application debugging on or off. | |
786 # | |
787 # @param passenger_lve_min_uid | |
788 # Sets [PassengerLveMinUid](https://www.phusionpassenger.com/library/config/apache/reference/#passengerlveminuid), | |
789 # to only allow the spawning of application processes with UIDs equal to, or higher than, this | |
790 # specified value on LVE-enabled kernels. | |
791 # | |
792 # @param php_values | |
793 # Allows per-virtual host setting [`php_value`s](http://php.net/manual/en/configuration.changes.php). | |
794 # These flags or values can be overwritten by a user or an application. | |
795 # Within a vhost declaration: | |
796 # ``` puppet | |
797 # php_values => [ 'include_path ".:/usr/local/example-app/include"' ], | |
798 # ``` | |
799 # | |
800 # @param php_flags | |
801 # Allows per-virtual host setting [`php_flags\``](http://php.net/manual/en/configuration.changes.php). | |
802 # These flags or values can be overwritten by a user or an application. | |
803 # | |
804 # @param php_admin_values | |
805 # Allows per-virtual host setting [`php_admin_value`](http://php.net/manual/en/configuration.changes.php). | |
806 # These flags or values cannot be overwritten by a user or an application. | |
807 # | |
808 # @param php_admin_flags | |
809 # Allows per-virtual host setting [`php_admin_flag`](http://php.net/manual/en/configuration.changes.php). | |
810 # These flags or values cannot be overwritten by a user or an application. | |
811 # | |
812 # @param port | |
813 # Sets the port the host is configured on. The module's defaults ensure the host listens | |
814 # on port 80 for non-SSL virtual hosts and port 443 for SSL virtual hosts. The host only | |
815 # listens on the port set in this parameter. | |
816 # | |
817 # @param priority | |
818 # Sets the relative load-order for Apache HTTPD VirtualHost configuration files.<br /> | |
819 # If nothing matches the priority, the first name-based virtual host is used. Likewise, | |
820 # passing a higher priority causes the alphabetically first name-based virtual host to be | |
821 # used if no other names match.<br /> | |
822 # > **Note:** You should not need to use this parameter. However, if you do use it, be | |
823 # aware that the `default_vhost` parameter for `apache::vhost` passes a priority of '15'.<br /> | |
824 # To omit the priority prefix in file names, pass a priority of `false`. | |
825 # | |
826 # @param protocols | |
827 # Sets the [Protocols](https://httpd.apache.org/docs/current/en/mod/core.html#protocols) | |
828 # directive, which lists available protocols for the virutal host. | |
829 # | |
830 # @param protocols_honor_order | |
831 # Sets the [ProtocolsHonorOrder](https://httpd.apache.org/docs/current/en/mod/core.html#protocolshonororder) | |
832 # directive which determines wether the order of Protocols sets precedence during negotiation. | |
833 # | |
834 # @param proxy_dest | |
835 # Specifies the destination address of a [ProxyPass](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass) configuration. | |
836 # | |
837 # @param proxy_pass | |
838 # Specifies an array of `path => URI` values for a [ProxyPass](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass) | |
839 # configuration. Optionally, parameters can be added as an array. | |
840 # ``` puppet | |
841 # apache::vhost { 'site.name.fdqn': | |
842 # … | |
843 # proxy_pass => [ | |
844 # { 'path' => '/a', 'url' => 'http://backend-a/' }, | |
845 # { 'path' => '/b', 'url' => 'http://backend-b/' }, | |
846 # { 'path' => '/c', 'url' => 'http://backend-a/c', 'params' => {'max'=>20, 'ttl'=>120, 'retry'=>300}}, | |
847 # { 'path' => '/l', 'url' => 'http://backend-xy', | |
848 # 'reverse_urls' => ['http://backend-x', 'http://backend-y'] }, | |
849 # { 'path' => '/d', 'url' => 'http://backend-a/d', | |
850 # 'params' => { 'retry' => '0', 'timeout' => '5' }, }, | |
851 # { 'path' => '/e', 'url' => 'http://backend-a/e', | |
852 # 'keywords' => ['nocanon', 'interpolate'] }, | |
853 # { 'path' => '/f', 'url' => 'http://backend-f/', | |
854 # 'setenv' => ['proxy-nokeepalive 1','force-proxy-request-1.0 1']}, | |
855 # { 'path' => '/g', 'url' => 'http://backend-g/', | |
856 # 'reverse_cookies' => [{'path' => '/g', 'url' => 'http://backend-g/',}, {'domain' => 'http://backend-g', 'url' => 'http:://backend-g',},], }, | |
857 # { 'path' => '/h', 'url' => 'http://backend-h/h', | |
858 # 'no_proxy_uris' => ['/h/admin', '/h/server-status'] }, | |
859 # ], | |
860 # } | |
861 # ``` | |
862 # * `reverse_urls`. *Optional.* This setting is useful when used with `mod_proxy_balancer`. Values: an array or string. | |
863 # * `reverse_cookies`. *Optional.* Sets `ProxyPassReverseCookiePath` and `ProxyPassReverseCookieDomain`. | |
864 # * `params`. *Optional.* Allows for ProxyPass key-value parameters, such as connection settings. | |
865 # * `setenv`. *Optional.* Sets [environment variables](https://httpd.apache.org/docs/current/mod/mod_proxy.html#envsettings) for the proxy directive. Values: array. | |
866 # | |
867 # @param proxy_dest_match | |
868 # This directive is equivalent to `proxy_dest`, but takes regular expressions, see | |
869 # [ProxyPassMatch](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassmatch) | |
870 # for details. | |
871 # | |
872 # @param proxy_dest_reverse_match | |
873 # Allows you to pass a ProxyPassReverse if `proxy_dest_match` is specified. See | |
874 # [ProxyPassReverse](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassreverse) | |
875 # for details. | |
876 # | |
877 # @param proxy_pass_match | |
878 # This directive is equivalent to `proxy_pass`, but takes regular expressions, see | |
879 # [ProxyPassMatch](https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassmatch) | |
880 # for details. | |
881 # | |
882 # @param redirect_dest | |
883 # Specifies the address to redirect to. | |
884 # | |
885 # @param redirect_source | |
886 # Specifies the source URIs that redirect to the destination specified in `redirect_dest`. | |
887 # If more than one item for redirect is supplied, the source and destination must be the same | |
888 # length, and the items are order-dependent. | |
889 # ``` puppet | |
890 # apache::vhost { 'site.name.fdqn': | |
891 # … | |
892 # redirect_source => ['/images','/downloads'], | |
893 # redirect_dest => ['http://img.example.com/','http://downloads.example.com/'], | |
894 # } | |
895 # ``` | |
896 # | |
897 # @param redirect_status | |
898 # Specifies the status to append to the redirect. | |
899 # ``` puppet | |
900 # apache::vhost { 'site.name.fdqn': | |
901 # … | |
902 # redirect_status => ['temp','permanent'], | |
903 # } | |
904 # ``` | |
905 # | |
906 # @param redirectmatch_regexp | |
907 # Determines which server status should be raised for a given regular expression | |
908 # and where to forward the user to. Entered as an array alongside redirectmatch_status | |
909 # and redirectmatch_dest. | |
910 # ``` puppet | |
911 # apache::vhost { 'site.name.fdqn': | |
912 # … | |
913 # redirectmatch_status => ['404','404'], | |
914 # redirectmatch_regexp => ['\.git(/.*|$)/','\.svn(/.*|$)'], | |
915 # redirectmatch_dest => ['http://www.example.com/$1','http://www.example.com/$2'], | |
916 # } | |
917 # ``` | |
918 # | |
919 # @param redirectmatch_status | |
920 # Determines which server status should be raised for a given regular expression | |
921 # and where to forward the user to. Entered as an array alongside redirectmatch_regexp | |
922 # and redirectmatch_dest. | |
923 # ``` puppet | |
924 # apache::vhost { 'site.name.fdqn': | |
925 # … | |
926 # redirectmatch_status => ['404','404'], | |
927 # redirectmatch_regexp => ['\.git(/.*|$)/','\.svn(/.*|$)'], | |
928 # redirectmatch_dest => ['http://www.example.com/$1','http://www.example.com/$2'], | |
929 # } | |
930 # ``` | |
931 # | |
932 # @param redirectmatch_dest | |
933 # Determines which server status should be raised for a given regular expression | |
934 # and where to forward the user to. Entered as an array alongside redirectmatch_status | |
935 # and redirectmatch_regexp. | |
936 # ``` puppet | |
937 # apache::vhost { 'site.name.fdqn': | |
938 # … | |
939 # redirectmatch_status => ['404','404'], | |
940 # redirectmatch_regexp => ['\.git(/.*|$)/','\.svn(/.*|$)'], | |
941 # redirectmatch_dest => ['http://www.example.com/$1','http://www.example.com/$2'], | |
942 # } | |
943 # ``` | |
944 # | |
945 # @param request_headers | |
946 # Modifies collected [request headers](https://httpd.apache.org/docs/current/mod/mod_headers.html#requestheader) | |
947 # in various ways, including adding additional request headers, removing request headers, | |
948 # and so on. | |
949 # ``` puppet | |
950 # apache::vhost { 'site.name.fdqn': | |
951 # … | |
952 # request_headers => [ | |
953 # 'append MirrorID "mirror 12"', | |
954 # 'unset MirrorID', | |
955 # ], | |
956 # } | |
957 # ``` | |
958 # | |
959 # @param rewrites | |
960 # Creates URL rewrite rules. Expects an array of hashes.<br /> | |
961 # Valid Hash keys include `comment`, `rewrite_base`, `rewrite_cond`, `rewrite_rule` | |
962 # or `rewrite_map`.<br /> | |
963 # For example, you can specify that anyone trying to access index.html is served welcome.html | |
964 # ``` puppet | |
965 # apache::vhost { 'site.name.fdqn': | |
966 # … | |
967 # rewrites => [ { rewrite_rule => ['^index\.html$ welcome.html'] } ] | |
968 # } | |
969 # ``` | |
970 # The parameter allows rewrite conditions that, when `true`, execute the associated rule. | |
971 # For instance, if you wanted to rewrite URLs only if the visitor is using IE | |
972 # ``` puppet | |
973 # apache::vhost { 'site.name.fdqn': | |
974 # … | |
975 # rewrites => [ | |
976 # { | |
977 # comment => 'redirect IE', | |
978 # rewrite_cond => ['%{HTTP_USER_AGENT} ^MSIE'], | |
979 # rewrite_rule => ['^index\.html$ welcome.html'], | |
980 # }, | |
981 # ], | |
982 # } | |
983 # ``` | |
984 # You can also apply multiple conditions. For instance, rewrite index.html to welcome.html | |
985 # only when the browser is Lynx or Mozilla (version 1 or 2) | |
986 # ``` puppet | |
987 # apache::vhost { 'site.name.fdqn': | |
988 # … | |
989 # rewrites => [ | |
990 # { | |
991 # comment => 'Lynx or Mozilla v1/2', | |
992 # rewrite_cond => ['%{HTTP_USER_AGENT} ^Lynx/ [OR]', '%{HTTP_USER_AGENT} ^Mozilla/[12]'], | |
993 # rewrite_rule => ['^index\.html$ welcome.html'], | |
994 # }, | |
995 # ], | |
996 # } | |
997 # ``` | |
998 # Multiple rewrites and conditions are also possible | |
999 # ``` puppet | |
1000 # apache::vhost { 'site.name.fdqn': | |
1001 # … | |
1002 # rewrites => [ | |
1003 # { | |
1004 # comment => 'Lynx or Mozilla v1/2', | |
1005 # rewrite_cond => ['%{HTTP_USER_AGENT} ^Lynx/ [OR]', '%{HTTP_USER_AGENT} ^Mozilla/[12]'], | |
1006 # rewrite_rule => ['^index\.html$ welcome.html'], | |
1007 # }, | |
1008 # { | |
1009 # comment => 'Internet Explorer', | |
1010 # rewrite_cond => ['%{HTTP_USER_AGENT} ^MSIE'], | |
1011 # rewrite_rule => ['^index\.html$ /index.IE.html [L]'], | |
1012 # }, | |
1013 # { | |
1014 # rewrite_base => /apps/, | |
1015 # rewrite_rule => ['^index\.cgi$ index.php', '^index\.html$ index.php', '^index\.asp$ index.html'], | |
1016 # }, | |
1017 # { comment => 'Rewrite to lower case', | |
1018 # rewrite_cond => ['%{REQUEST_URI} [A-Z]'], | |
1019 # rewrite_map => ['lc int:tolower'], | |
1020 # rewrite_rule => ['(.*) ${lc:$1} [R=301,L]'], | |
1021 # }, | |
1022 # ], | |
1023 # } | |
1024 # ``` | |
1025 # Refer to the [`mod_rewrite` documentation](https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html) | |
1026 # for more details on what is possible with rewrite rules and conditions.<br /> | |
1027 # > **Note**: If you include rewrites in your directories, also include `apache::mod::rewrite` | |
1028 # and consider setting the rewrites using the `rewrites` parameter in `apache::vhost` rather | |
1029 # than setting the rewrites in the virtual host's directories. | |
1030 # | |
1031 # @param rewrite_base | |
1032 # The parameter [`rewrite_base`](https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase) | |
1033 # specifies the URL prefix to be used for per-directory (htaccess) RewriteRule directives | |
1034 # that substitue a relative path. | |
1035 # | |
1036 # @param rewrite_rule | |
1037 # The parameter [`rewrite_rile`](https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule) | |
1038 # allows the user to define the rules that will be used by the rewrite engine. | |
1039 # | |
1040 # @param rewrite_cond | |
1041 # The parameter [`rewrite_cond`](https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond) | |
1042 # defines a rule condition, that when satisfied will implement that rule within the | |
1043 # rewrite engine. | |
1044 # | |
1045 # @param rewrite_inherit | |
1046 # Determines whether the virtual host inherits global rewrite rules.<br /> | |
1047 # Rewrite rules may be specified globally (in `$conf_file` or `$confd_dir`) or | |
1048 # inside the virtual host `.conf` file. By default, virtual hosts do not inherit | |
1049 # global settings. To activate inheritance, specify the `rewrites` parameter and set | |
1050 # `rewrite_inherit` parameter to `true`: | |
1051 # ``` puppet | |
1052 # apache::vhost { 'site.name.fdqn': | |
1053 # … | |
1054 # rewrites => [ | |
1055 # <rules>, | |
1056 # ], | |
1057 # rewrite_inherit => `true`, | |
1058 # } | |
1059 # ``` | |
1060 # > **Note**: The `rewrites` parameter is **required** for this to have effect<br /> | |
1061 # Apache activates global `Rewrite` rules inheritance if the virtual host files contains | |
1062 # the following directives: | |
1063 # ``` ApacheConf | |
1064 # RewriteEngine On | |
1065 # RewriteOptions Inherit | |
1066 # ``` | |
1067 # Refer to the official [`mod_rewrite`](https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html) | |
1068 # documentation, section "Rewriting in Virtual Hosts". | |
1069 # | |
1070 # @param scriptalias | |
1071 # Defines a directory of CGI scripts to be aliased to the path '/cgi-bin', such as | |
1072 # '/usr/scripts'. | |
1073 # | |
1074 # @param scriptaliases | |
1075 # > **Note**: This parameter is deprecated in favor of the `aliases` parameter.<br /> | |
1076 # Passes an array of hashes to the virtual host to create either ScriptAlias or | |
1077 # ScriptAliasMatch statements per the `mod_alias` documentation. | |
1078 # ``` puppet | |
1079 # scriptaliases => [ | |
1080 # { | |
1081 # alias => '/myscript', | |
1082 # path => '/usr/share/myscript', | |
1083 # }, | |
1084 # { | |
1085 # aliasmatch => '^/foo(.*)', | |
1086 # path => '/usr/share/fooscripts$1', | |
1087 # }, | |
1088 # { | |
1089 # aliasmatch => '^/bar/(.*)', | |
1090 # path => '/usr/share/bar/wrapper.sh/$1', | |
1091 # }, | |
1092 # { | |
1093 # alias => '/neatscript', | |
1094 # path => '/usr/share/neatscript', | |
1095 # }, | |
1096 # ] | |
1097 # ``` | |
1098 # The ScriptAlias and ScriptAliasMatch directives are created in the order specified. | |
1099 # As with [Alias and AliasMatch](#aliases) directives, specify more specific aliases | |
1100 # before more general ones to avoid shadowing. | |
1101 # | |
1102 # @param serveradmin | |
1103 # Specifies the email address Apache displays when it renders one of its error pages. | |
1104 # | |
1105 # @param serveraliases | |
1106 # Sets the [ServerAliases](https://httpd.apache.org/docs/current/mod/core.html#serveralias) | |
1107 # of the site. | |
1108 # | |
1109 # @param servername | |
1110 # Sets the servername corresponding to the hostname you connect to the virtual host at. | |
1111 # | |
1112 # @param setenv | |
1113 # Used by HTTPD to set environment variables for virtual hosts.<br /> | |
1114 # Example: | |
1115 # ``` puppet | |
1116 # apache::vhost { 'setenv.example.com': | |
1117 # setenv => ['SPECIAL_PATH /foo/bin'], | |
1118 # } | |
1119 # ``` | |
1120 # | |
1121 # @param setenvif | |
1122 # Used by HTTPD to conditionally set environment variables for virtual hosts. | |
1123 # | |
1124 # @param setenvifnocase | |
1125 # Used by HTTPD to conditionally set environment variables for virtual hosts (caseless matching). | |
1126 # | |
1127 # @param suexec_user_group | |
1128 # Allows the spcification of user and group execution privileges for CGI programs through | |
1129 # inclusion of the `mod_suexec` module. | |
1130 # | |
1131 # @param suphp_addhandler | |
1132 # Sets up a virtual host with [suPHP](http://suphp.org/DocumentationView.html?file=apache/CONFIG) | |
1133 # working together with suphp_configpath and suphp_engine.<br /> | |
1134 # An example virtual host configuration with suPHP: | |
1135 # ``` puppet | |
1136 # apache::vhost { 'suphp.example.com': | |
1137 # port => '80', | |
1138 # docroot => '/home/appuser/myphpapp', | |
1139 # suphp_addhandler => 'x-httpd-php', | |
1140 # suphp_engine => 'on', | |
1141 # suphp_configpath => '/etc/php5/apache2', | |
1142 # directories => { path => '/home/appuser/myphpapp', | |
1143 # 'suphp' => { user => 'myappuser', group => 'myappgroup' }, | |
1144 # } | |
1145 # } | |
1146 # ``` | |
1147 # | |
1148 # @param suphp_configpath | |
1149 # Sets up a virtual host with [suPHP](http://suphp.org/DocumentationView.html?file=apache/CONFIG) | |
1150 # working together with suphp_addhandler and suphp_engine.<br /> | |
1151 # An example virtual host configuration with suPHP: | |
1152 # ``` puppet | |
1153 # apache::vhost { 'suphp.example.com': | |
1154 # port => '80', | |
1155 # docroot => '/home/appuser/myphpapp', | |
1156 # suphp_addhandler => 'x-httpd-php', | |
1157 # suphp_engine => 'on', | |
1158 # suphp_configpath => '/etc/php5/apache2', | |
1159 # directories => { path => '/home/appuser/myphpapp', | |
1160 # 'suphp' => { user => 'myappuser', group => 'myappgroup' }, | |
1161 # } | |
1162 # } | |
1163 # ``` | |
1164 # | |
1165 # @param suphp_engine | |
1166 # Sets up a virtual host with [suPHP](http://suphp.org/DocumentationView.html?file=apache/CONFIG) | |
1167 # working together with suphp_configpath and suphp_addhandler.<br /> | |
1168 # An example virtual host configuration with suPHP: | |
1169 # ``` puppet | |
1170 # apache::vhost { 'suphp.example.com': | |
1171 # port => '80', | |
1172 # docroot => '/home/appuser/myphpapp', | |
1173 # suphp_addhandler => 'x-httpd-php', | |
1174 # suphp_engine => 'on', | |
1175 # suphp_configpath => '/etc/php5/apache2', | |
1176 # directories => { path => '/home/appuser/myphpapp', | |
1177 # 'suphp' => { user => 'myappuser', group => 'myappgroup' }, | |
1178 # } | |
1179 # } | |
1180 # ``` | |
1181 # | |
1182 # @param vhost_name | |
1183 # Enables name-based virtual hosting. If no IP is passed to the virtual host, but the | |
1184 # virtual host is assigned a port, then the virtual host name is `vhost_name:port`. | |
1185 # If the virtual host has no assigned IP or port, the virtual host name is set to the | |
1186 # title of the resource. | |
1187 # | |
1188 # @param virtual_docroot | |
1189 # Sets up a virtual host with a wildcard alias subdomain mapped to a directory with the | |
1190 # same name. For example, `http://example.com` would map to `/var/www/example.com`. | |
1191 # ``` puppet | |
1192 # apache::vhost { 'subdomain.loc': | |
1193 # vhost_name => '*', | |
1194 # port => '80', | |
1195 # virtual_docroot => '/var/www/%-2+', | |
1196 # docroot => '/var/www', | |
1197 # serveraliases => ['*.loc',], | |
1198 # } | |
1199 # ``` | |
1200 # | |
1201 # @param wsgi_daemon_process | |
1202 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1203 # wsgi_daemon_process_options, wsgi_process_group, | |
1204 # wsgi_script_aliases and wsgi_pass_authorization.<br /> | |
1205 # A hash that sets the name of the WSGI daemon, accepting | |
1206 # [certain keys](http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIDaemonProcess.html).<br /> | |
1207 # An example virtual host configuration with WSGI: | |
1208 # ``` puppet | |
1209 # apache::vhost { 'wsgi.example.com': | |
1210 # port => '80', | |
1211 # docroot => '/var/www/pythonapp', | |
1212 # wsgi_daemon_process => 'wsgi', | |
1213 # wsgi_daemon_process_options => | |
1214 # { processes => '2', | |
1215 # threads => '15', | |
1216 # display-name => '%{GROUP}', | |
1217 # }, | |
1218 # wsgi_process_group => 'wsgi', | |
1219 # wsgi_script_aliases => { '/' => '/var/www/demo.wsgi' }, | |
1220 # wsgi_chunked_request => 'On', | |
1221 # } | |
1222 # ``` | |
1223 # | |
1224 # @param wsgi_daemon_process_options | |
1225 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1226 # wsgi_daemon_process, wsgi_process_group, | |
1227 # wsgi_script_aliases and wsgi_pass_authorization.<br /> | |
1228 # Sets the group ID that the virtual host runs under. | |
1229 # | |
1230 # @param wsgi_application_group | |
1231 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1232 # wsgi_daemon_process, wsgi_daemon_process_options, wsgi_process_group, | |
1233 # and wsgi_pass_authorization.<br /> | |
1234 # This parameter defines the [`WSGIApplicationGroup directive`](https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIApplicationGroup.html), | |
1235 # thus allowing you to specify which application group the WSGI application belongs to, | |
1236 # with all WSGI applications within the same group executing within the context of the | |
1237 # same Python sub interpreter. | |
1238 # | |
1239 # @param wsgi_import_script | |
1240 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1241 # wsgi_daemon_process, wsgi_daemon_process_options, wsgi_process_group, | |
1242 # and wsgi_pass_authorization.<br /> | |
1243 # This parameter defines the [`WSGIImportScript directive`](https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIImportScript.html), | |
1244 # which can be used in order to specify a script file to be loaded upon a process starting. | |
1245 # | |
1246 # @param wsgi_import_script_options | |
1247 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1248 # wsgi_daemon_process, wsgi_daemon_process_options, wsgi_process_group, | |
1249 # and wsgi_pass_authorization.<br /> | |
1250 # This parameter defines the [`WSGIImportScript directive`](https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIImportScript.html), | |
1251 # which can be used in order to specify a script file to be loaded upon a process starting.<br /> | |
1252 # Specifies the process and aplication groups of the script. | |
1253 # | |
1254 # @param wsgi_chunked_request | |
1255 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1256 # wsgi_daemon_process, wsgi_daemon_process_options, wsgi_process_group, | |
1257 # and wsgi_pass_authorization.<br /> | |
1258 # This parameter defines the [`WSGIChunkedRequest directive`](https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIChunkedRequest.html), | |
1259 # allowing you to enable support for chunked request content.<br /> | |
1260 # WSGI is technically incapable of supporting chunked request content without all chunked | |
1261 # request content having first been read in and buffered. | |
1262 # | |
1263 # @param wsgi_process_group | |
1264 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1265 # wsgi_daemon_process, wsgi_daemon_process_options, | |
1266 # wsgi_script_aliases and wsgi_pass_authorization.<br /> | |
1267 # Requires a hash of web paths to filesystem `.wsgi paths/`. | |
1268 # | |
1269 # @param wsgi_script_aliases | |
1270 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1271 # wsgi_daemon_process, wsgi_daemon_process_options, wsgi_process_group, | |
1272 # and wsgi_pass_authorization.<br /> | |
1273 # Uses the WSGI application to handle authorization instead of Apache when set to `On`.<br /> | |
1274 # For more information, see mod_wsgi's [WSGIPassAuthorization documentation](https://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIPassAuthorization.html). | |
1275 # | |
1276 # @param wsgi_script_aliases_match | |
1277 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1278 # wsgi_daemon_process, wsgi_daemon_process_options, wsgi_process_group, | |
1279 # and wsgi_pass_authorization.<br /> | |
1280 # Uses the WSGI application to handle authorization instead of Apache when set to `On`.<br /> | |
1281 # This directive is similar to `wsgi_script_aliases`, but makes use of regular expressions | |
1282 # in place of simple prefix matching.<br /> | |
1283 # For more information, see mod_wsgi's [WSGIPassAuthorization documentation](https://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIPassAuthorization.html). | |
1284 # | |
1285 # @param wsgi_pass_authorization | |
1286 # Sets up a virtual host with [WSGI](https://github.com/GrahamDumpleton/mod_wsgi) alongside | |
1287 # wsgi_daemon_process, wsgi_daemon_process_options, wsgi_process_group and | |
1288 # wsgi_script_aliases.<br /> | |
1289 # Enables support for chunked requests. | |
1290 # | |
1291 # @param directories | |
1292 # The `directories` parameter within the `apache::vhost` class passes an array of hashes | |
1293 # to the virtual host to create [Directory](https://httpd.apache.org/docs/current/mod/core.html#directory), | |
1294 # [File](https://httpd.apache.org/docs/current/mod/core.html#files), and | |
1295 # [Location](https://httpd.apache.org/docs/current/mod/core.html#location) directive blocks. | |
1296 # These blocks take the form, `< Directory /path/to/directory>...< /Directory>`.<br /> | |
1297 # The `path` key sets the path for the directory, files, and location blocks. Its value | |
1298 # must be a path for the `directory`, `files`, and `location` providers, or a regex for | |
1299 # the `directorymatch`, `filesmatch`, or `locationmatch` providers. Each hash passed to | |
1300 # `directories` **must** contain `path` as one of the keys.<br /> | |
1301 # The `provider` key is optional. If missing, this key defaults to `directory`. | |
1302 # Values: `directory`, `files`, `proxy`, `location`, `directorymatch`, `filesmatch`, | |
1303 # `proxymatch` or `locationmatch`. If you set `provider` to `directorymatch`, it | |
1304 # uses the keyword `DirectoryMatch` in the Apache config file.<br /> | |
1305 # An example use of `directories`: | |
1306 # ``` puppet | |
1307 # apache::vhost { 'files.example.net': | |
1308 # docroot => '/var/www/files', | |
1309 # directories => [ | |
1310 # { 'path' => '/var/www/files', | |
1311 # 'provider' => 'files', | |
1312 # 'deny' => 'from all', | |
1313 # }, | |
1314 # ], | |
1315 # } | |
1316 # ``` | |
1317 # > **Note:** At least one directory should match the `docroot` parameter. After you | |
1318 # start declaring directories, `apache::vhost` assumes that all required Directory blocks | |
1319 # will be declared. If not defined, a single default Directory block is created that matches | |
1320 # the `docroot` parameter.<br /> | |
1321 # Available handlers, represented as keys, should be placed within the `directory`, | |
1322 # `files`, or `location` hashes. This looks like | |
1323 # ``` puppet | |
1324 # apache::vhost { 'sample.example.net': | |
1325 # docroot => '/path/to/directory', | |
1326 # directories => [ { path => '/path/to/directory', handler => value } ], | |
1327 # } | |
1328 # ``` | |
1329 # Any handlers you do not set in these hashes are considered `undefined` within Puppet and | |
1330 # are not added to the virtual host, resulting in the module using their default values. | |
1331 # | |
1332 # @param custom_fragment | |
1333 # Pass a string of custom configuration directives to be placed at the end of the directory | |
1334 # configuration. | |
1335 # ``` puppet | |
1336 # apache::vhost { 'monitor': | |
1337 # … | |
1338 # directories => [ | |
1339 # { | |
1340 # path => '/path/to/directory', | |
1341 # custom_fragment => ' | |
1342 # <Location /balancer-manager> | |
1343 # SetHandler balancer-manager | |
1344 # Order allow,deny | |
1345 # Allow from all | |
1346 # </Location> | |
1347 # <Location /server-status> | |
1348 # SetHandler server-status | |
1349 # Order allow,deny | |
1350 # Allow from all | |
1351 # </Location> | |
1352 # ProxyStatus On', | |
1353 # }, | |
1354 # ] | |
1355 # } | |
1356 # ``` | |
1357 # | |
1358 # @param error_documents | |
1359 # An array of hashes used to override the [ErrorDocument](https://httpd.apache.org/docs/current/mod/core.html#errordocument) | |
1360 # settings for the directory. | |
1361 # ``` puppet | |
1362 # apache::vhost { 'sample.example.net': | |
1363 # directories => [ | |
1364 # { path => '/srv/www', | |
1365 # error_documents => [ | |
1366 # { 'error_code' => '503', | |
1367 # 'document' => '/service-unavail', | |
1368 # }, | |
1369 # ], | |
1370 # }, | |
1371 # ], | |
1372 # } | |
1373 # ``` | |
1374 # | |
1375 # @param h2_copy_files | |
1376 # Sets the [H2CopyFiles](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2copyfiles) directive.<br /> | |
1377 # Note that you must declare `class {'apache::mod::http2': }` before using this directive. | |
1378 # | |
1379 # @param h2_push_resource | |
1380 # Sets the [H2PushResource](https://httpd.apache.org/docs/current/mod/mod_http2.html#h2pushresource) directive.<br /> | |
1381 # Note that you must declare `class {'apache::mod::http2': }` before using this directive. | |
1382 # | |
1383 # @param headers | |
1384 # Adds lines for [Header](https://httpd.apache.org/docs/current/mod/mod_headers.html#header) directives. | |
1385 # ``` puppet | |
1386 # apache::vhost { 'sample.example.net': | |
1387 # docroot => '/path/to/directory', | |
1388 # directories => { | |
1389 # path => '/path/to/directory', | |
1390 # headers => 'Set X-Robots-Tag "noindex, noarchive, nosnippet"', | |
1391 # }, | |
1392 # } | |
1393 # ``` | |
1394 # | |
1395 # @param options | |
1396 # Lists the [Options](https://httpd.apache.org/docs/current/mod/core.html#options) for the | |
1397 # given Directory block. | |
1398 # ``` puppet | |
1399 # apache::vhost { 'sample.example.net': | |
1400 # docroot => '/path/to/directory', | |
1401 # directories => [ | |
1402 # { path => '/path/to/directory', | |
1403 # options => ['Indexes','FollowSymLinks','MultiViews'], | |
1404 # }, | |
1405 # ], | |
1406 # } | |
1407 # ``` | |
1408 # | |
1409 # @param shib_compat_valid_user | |
1410 # Default is Off, matching the behavior prior to this command's existence. Addresses a conflict | |
1411 # when using Shibboleth in conjunction with other auth/auth modules by restoring `standard` | |
1412 # Apache behavior when processing the `valid-user` and `user` Require rules. See the | |
1413 # [`mod_shib`documentation](https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPApacheConfig#NativeSPApacheConfig-Server/VirtualHostOptions), | |
1414 # and [NativeSPhtaccess](https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPhtaccess) | |
1415 # topic for more details. This key is disabled if `apache::mod::shib` is not defined. | |
1416 # | |
1417 # @param ssl_options | |
1418 # String or list of [SSLOptions](https://httpd.apache.org/docs/current/mod/mod_ssl.html#ssloptions), | |
1419 # which configure SSL engine run-time options. This handler takes precedence over SSLOptions | |
1420 # set in the parent block of the virtual host. | |
1421 # ``` puppet | |
1422 # apache::vhost { 'secure.example.net': | |
1423 # docroot => '/path/to/directory', | |
1424 # directories => [ | |
1425 # { path => '/path/to/directory', | |
1426 # ssl_options => '+ExportCertData', | |
1427 # }, | |
1428 # { path => '/path/to/different/dir', | |
1429 # ssl_options => ['-StdEnvVars', '+ExportCertData'], | |
1430 # }, | |
1431 # ], | |
1432 # } | |
1433 # ``` | |
1434 # | |
1435 # @param additional_includes | |
1436 # Specifies paths to additional static, specific Apache configuration files in virtual | |
1437 # host directories. | |
1438 # ``` puppet | |
1439 # apache::vhost { 'sample.example.net': | |
1440 # docroot => '/path/to/directory', | |
1441 # directories => [ | |
1442 # { path => '/path/to/different/dir', | |
1443 # additional_includes => ['/custom/path/includes', '/custom/path/another_includes',], | |
1444 # }, | |
1445 # ], | |
1446 # } | |
1447 # ``` | |
1448 # | |
1449 # @param ssl | |
1450 # Enables SSL for the virtual host. SSL virtual hosts only respond to HTTPS queries. | |
1451 # | |
1452 # @param ssl_ca | |
1453 # Specifies the SSL certificate authority to be used to verify client certificates used | |
1454 # for authentication. You must also set `ssl_verify_client` to use this. | |
1455 # | |
1456 # @param ssl_cert | |
1457 # Specifies the SSL certification. | |
1458 # | |
1459 # @param ssl_protocol | |
1460 # Specifies [SSLProtocol](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslprotocol). | |
1461 # Expects an array or space separated string of accepted protocols. | |
1462 # | |
1463 # @param ssl_cipher | |
1464 # Specifies [SSLCipherSuite](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslciphersuite). | |
1465 # | |
1466 # @param ssl_honorcipherorder | |
1467 # Sets [SSLHonorCipherOrder](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslhonorcipherorder), | |
1468 # to cause Apache to use the server's preferred order of ciphers rather than the client's | |
1469 # preferred order. | |
1470 # | |
1471 # @param ssl_certs_dir | |
1472 # Specifies the location of the SSL certification directory to verify client certs. Will not | |
1473 # be used unless `ssl_verify_client` is also set (see below). | |
1474 # | |
1475 # @param ssl_chain | |
1476 # Specifies the SSL chain. This default works out of the box, but it must be updated in | |
1477 # the base `apache` class with your specific certificate information before being used in | |
1478 # production. | |
1479 # | |
1480 # @param ssl_crl | |
1481 # Specifies the certificate revocation list to use. (This default works out of the box but | |
1482 # must be updated in the base `apache` class with your specific certificate information | |
1483 # before being used in production.) | |
1484 # | |
1485 # @param ssl_crl_path | |
1486 # Specifies the location of the certificate revocation list to verify certificates for | |
1487 # client authentication with. (This default works out of the box but must be updated in | |
1488 # the base `apache` class with your specific certificate information before being used in | |
1489 # production.) | |
1490 # | |
1491 # @param ssl_crl_check | |
1492 # Sets the certificate revocation check level via the [SSLCARevocationCheck directive](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcarevocationcheck) | |
1493 # for ssl client authentication. The default works out of the box but must be specified when | |
1494 # using CRLs in production. Only applicable to Apache 2.4 or higher; the value is ignored on | |
1495 # older versions. | |
1496 # | |
1497 # @param ssl_key | |
1498 # Specifies the SSL key.<br /> | |
1499 # Defaults are based on your operating system. Default work out of the box but must be | |
1500 # updated in the base `apache` class with your specific certificate information before | |
1501 # being used in production. | |
1502 # | |
1503 # @param ssl_verify_client | |
1504 # Sets the [SSLVerifyClient](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslverifyclient) | |
1505 # directive, which sets the certificate verification level for client authentication. | |
1506 # ``` puppet | |
1507 # apache::vhost { 'sample.example.net': | |
1508 # … | |
1509 # ssl_verify_client => 'optional', | |
1510 # } | |
1511 # ``` | |
1512 # | |
1513 # @param ssl_verify_depth | |
1514 # Sets the [SSLVerifyDepth](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslverifydepth) | |
1515 # directive, which specifies the maximum depth of CA certificates in client certificate | |
1516 # verification. You must set `ssl_verify_client` for it to take effect. | |
1517 # ``` puppet | |
1518 # apache::vhost { 'sample.example.net': | |
1519 # … | |
1520 # ssl_verify_client => 'require', | |
1521 # ssl_verify_depth => 1, | |
1522 # } | |
1523 # ``` | |
1524 # | |
1525 # @param ssl_proxy_protocol | |
1526 # Sets the [SSLProxyProtocol](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxyprotocol) | |
1527 # directive, which controls which SSL protocol flavors `mod_ssl` should use when establishing | |
1528 # its server environment for proxy. It connects to servers using only one of the provided | |
1529 # protocols. | |
1530 # | |
1531 # @param ssl_proxy_verify | |
1532 # Sets the [SSLProxyVerify](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxyverify) | |
1533 # directive, which configures certificate verification of the remote server when a proxy is | |
1534 # configured to forward requests to a remote SSL server. | |
1535 # | |
1536 # @param ssl_proxy_verify_depth | |
1537 # Sets the [SSLProxyVerifyDepth](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxyverifydepth) | |
1538 # directive, which configures how deeply mod_ssl should verify before deciding that the | |
1539 # remote server does not have a valid certificate.<br /> | |
1540 # A depth of 0 means that only self-signed remote server certificates are accepted, | |
1541 # the default depth of 1 means the remote server certificate can be self-signed or | |
1542 # signed by a CA that is directly known to the server. | |
1543 # | |
1544 # @param ssl_proxy_cipher_suite | |
1545 # Sets the [SSLProxyCipherSuite](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxyciphersuite) | |
1546 # directive, which controls cipher suites supported for ssl proxy traffic. | |
1547 # | |
1548 # @param ssl_proxy_ca_cert | |
1549 # Sets the [SSLProxyCACertificateFile](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycacertificatefile) | |
1550 # directive, which specifies an all-in-one file where you can assemble the Certificates | |
1551 # of Certification Authorities (CA) whose remote servers you deal with. These are used | |
1552 # for Remote Server Authentication. This file should be a concatenation of the PEM-encoded | |
1553 # certificate files in order of preference. | |
1554 # | |
1555 # @param ssl_proxy_machine_cert | |
1556 # Sets the [SSLProxyMachineCertificateFile](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxymachinecertificatefile) | |
1557 # directive, which specifies an all-in-one file where you keep the certs and keys used | |
1558 # for this server to authenticate itself to remote servers. This file should be a | |
1559 # concatenation of the PEM-encoded certificate files in order of preference. | |
1560 # ``` puppet | |
1561 # apache::vhost { 'sample.example.net': | |
1562 # … | |
1563 # ssl_proxy_machine_cert => '/etc/httpd/ssl/client_certificate.pem', | |
1564 # } | |
1565 # ``` | |
1566 # | |
1567 # @param ssl_proxy_check_peer_cn | |
1568 # Sets the [SSLProxyCheckPeerCN](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycheckpeercn) | |
1569 # directive, which specifies whether the remote server certificate's CN field is compared | |
1570 # against the hostname of the request URL. | |
1571 # | |
1572 # @param ssl_proxy_check_peer_name | |
1573 # Sets the [SSLProxyCheckPeerName](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycheckpeername) | |
1574 # directive, which specifies whether the remote server certificate's CN field is compared | |
1575 # against the hostname of the request URL. | |
1576 # | |
1577 # @param ssl_proxy_check_peer_expire | |
1578 # Sets the [SSLProxyCheckPeerExpire](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxycheckpeerexpire) | |
1579 # directive, which specifies whether the remote server certificate is checked for expiration | |
1580 # or not. | |
1581 # | |
1582 # @param ssl_options | |
1583 # Sets the [SSLOptions](https://httpd.apache.org/docs/current/mod/mod_ssl.html#ssloptions) | |
1584 # directive, which configures various SSL engine run-time options. This is the global | |
1585 # setting for the given virtual host and can be a string or an array.<br /> | |
1586 # A string: | |
1587 # ``` puppet | |
1588 # apache::vhost { 'sample.example.net': | |
1589 # … | |
1590 # ssl_options => '+ExportCertData', | |
1591 # } | |
1592 # ``` | |
1593 # An array: | |
1594 # ``` puppet | |
1595 # apache::vhost { 'sample.example.net': | |
1596 # … | |
1597 # ssl_options => ['+StrictRequire', '+ExportCertData'], | |
1598 # } | |
1599 # ``` | |
1600 # | |
1601 # @param ssl_openssl_conf_cmd | |
1602 # Sets the [SSLOpenSSLConfCmd](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslopensslconfcmd) | |
1603 # directive, which provides direct configuration of OpenSSL parameters. | |
1604 # | |
1605 # @param ssl_proxyengine | |
1606 # Specifies whether or not to use [SSLProxyEngine](https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslproxyengine). | |
1607 # | |
1608 # @param ssl_stapling | |
1609 # Specifies whether or not to use [SSLUseStapling](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslusestapling). | |
1610 # By default, uses what is set globally.<br /> | |
1611 # This parameter only applies to Apache 2.4 or higher and is ignored on older versions. | |
1612 # | |
1613 # @param ssl_stapling_timeout | |
1614 # Can be used to set the [SSLStaplingResponderTimeout](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslstaplingrespondertimeout) directive.<br /> | |
1615 # This parameter only applies to Apache 2.4 or higher and is ignored on older versions. | |
1616 # | |
1617 # @param ssl_stapling_return_errors | |
1618 # Can be used to set the [SSLStaplingReturnResponderErrors](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslstaplingreturnrespondererrors) directive.<br /> | |
1619 # This parameter only applies to Apache 2.4 or higher and is ignored on older versions. | |
1620 # | |
1621 # @param use_canonical_name | |
1622 # Specifies whether to use the [`UseCanonicalName directive`](https://httpd.apache.org/docs/2.4/mod/core.html#usecanonicalname), | |
1623 # which allows you to configure how the server determines it's own name and port. | |
1624 # | |
1625 # @param define | |
1626 # this lets you define configuration variables inside a vhost using [`Define`](https://httpd.apache.org/docs/2.4/mod/core.html#define), | |
1627 # these can then be used to replace configuration values. All Defines are Undefined at the end of the VirtualHost. | |
1628 # | |
2 define apache::vhost( | 1629 define apache::vhost( |
3 $docroot, | 1630 Variant[Boolean,String] $docroot, |
4 $manage_docroot = true, | 1631 $manage_docroot = true, |
5 $virtual_docroot = false, | 1632 $virtual_docroot = false, |
6 $port = undef, | 1633 $port = undef, |
7 $ip = undef, | 1634 $ip = undef, |
8 $ip_based = false, | 1635 Boolean $ip_based = false, |
9 $add_listen = true, | 1636 $add_listen = true, |
10 $docroot_owner = 'root', | 1637 $docroot_owner = 'root', |
11 $docroot_group = $::apache::params::root_group, | 1638 $docroot_group = $::apache::params::root_group, |
12 $docroot_mode = undef, | 1639 $docroot_mode = undef, |
13 $serveradmin = undef, | 1640 Array[Enum['h2', 'h2c', 'http/1.1']] $protocols = [], |
14 $ssl = false, | 1641 Optional[Boolean] $protocols_honor_order = undef, |
15 $ssl_cert = $::apache::default_ssl_cert, | 1642 $serveradmin = undef, |
16 $ssl_key = $::apache::default_ssl_key, | 1643 Boolean $ssl = false, |
17 $ssl_chain = $::apache::default_ssl_chain, | 1644 $ssl_cert = $::apache::default_ssl_cert, |
18 $ssl_ca = $::apache::default_ssl_ca, | 1645 $ssl_key = $::apache::default_ssl_key, |
19 $ssl_crl_path = $::apache::default_ssl_crl_path, | 1646 $ssl_chain = $::apache::default_ssl_chain, |
20 $ssl_crl = $::apache::default_ssl_crl, | 1647 $ssl_ca = $::apache::default_ssl_ca, |
21 $ssl_crl_check = $::apache::default_ssl_crl_check, | 1648 $ssl_crl_path = $::apache::default_ssl_crl_path, |
22 $ssl_certs_dir = $::apache::params::ssl_certs_dir, | 1649 $ssl_crl = $::apache::default_ssl_crl, |
23 $ssl_protocol = undef, | 1650 $ssl_crl_check = $::apache::default_ssl_crl_check, |
24 $ssl_cipher = undef, | 1651 $ssl_certs_dir = $::apache::params::ssl_certs_dir, |
25 $ssl_honorcipherorder = undef, | 1652 $ssl_protocol = undef, |
26 $ssl_verify_client = undef, | 1653 $ssl_cipher = undef, |
27 $ssl_verify_depth = undef, | 1654 $ssl_honorcipherorder = undef, |
28 $ssl_proxy_verify = undef, | 1655 $ssl_verify_client = undef, |
29 $ssl_proxy_check_peer_cn = undef, | 1656 $ssl_verify_depth = undef, |
30 $ssl_proxy_check_peer_name = undef, | 1657 Optional[Enum['none', 'optional', 'require', 'optional_no_ca']] $ssl_proxy_verify = undef, |
31 $ssl_proxy_check_peer_expire = undef, | 1658 Optional[Integer[0]] $ssl_proxy_verify_depth = undef, |
32 $ssl_proxy_machine_cert = undef, | 1659 $ssl_proxy_ca_cert = undef, |
33 $ssl_proxy_protocol = undef, | 1660 Optional[Enum['on', 'off']] $ssl_proxy_check_peer_cn = undef, |
34 $ssl_options = undef, | 1661 Optional[Enum['on', 'off']] $ssl_proxy_check_peer_name = undef, |
35 $ssl_openssl_conf_cmd = undef, | 1662 Optional[Enum['on', 'off']] $ssl_proxy_check_peer_expire = undef, |
36 $ssl_proxyengine = false, | 1663 $ssl_proxy_machine_cert = undef, |
37 $ssl_stapling = undef, | 1664 $ssl_proxy_cipher_suite = undef, |
38 $ssl_stapling_timeout = undef, | 1665 $ssl_proxy_protocol = undef, |
39 $ssl_stapling_return_errors = undef, | 1666 $ssl_options = undef, |
40 $priority = undef, | 1667 $ssl_openssl_conf_cmd = undef, |
41 $default_vhost = false, | 1668 Boolean $ssl_proxyengine = false, |
42 $servername = $name, | 1669 Optional[Boolean] $ssl_stapling = undef, |
43 $serveraliases = [], | 1670 $ssl_stapling_timeout = undef, |
44 $options = ['Indexes','FollowSymLinks','MultiViews'], | 1671 $ssl_stapling_return_errors = undef, |
45 $override = ['None'], | 1672 $priority = undef, |
46 $directoryindex = '', | 1673 Boolean $default_vhost = false, |
47 $vhost_name = '*', | 1674 $servername = $name, |
48 $logroot = $::apache::logroot, | 1675 $serveraliases = [], |
49 $logroot_ensure = 'directory', | 1676 $options = ['Indexes','FollowSymLinks','MultiViews'], |
50 $logroot_mode = undef, | 1677 $override = ['None'], |
51 $logroot_owner = undef, | 1678 $directoryindex = '', |
52 $logroot_group = undef, | 1679 $vhost_name = '*', |
53 $log_level = undef, | 1680 $logroot = $::apache::logroot, |
54 $access_log = true, | 1681 Enum['directory', 'absent'] $logroot_ensure = 'directory', |
55 $access_log_file = false, | 1682 $logroot_mode = undef, |
56 $access_log_pipe = false, | 1683 $logroot_owner = undef, |
57 $access_log_syslog = false, | 1684 $logroot_group = undef, |
58 $access_log_format = false, | 1685 $log_level = undef, |
59 $access_log_env_var = false, | 1686 Boolean $access_log = true, |
60 $access_logs = undef, | 1687 $access_log_file = false, |
61 $aliases = undef, | 1688 $access_log_pipe = false, |
62 $directories = undef, | 1689 $access_log_syslog = false, |
63 $error_log = true, | 1690 $access_log_format = false, |
64 $error_log_file = undef, | 1691 $access_log_env_var = false, |
65 $error_log_pipe = undef, | 1692 Optional[Array] $access_logs = undef, |
66 $error_log_syslog = undef, | 1693 $aliases = undef, |
67 $modsec_audit_log = undef, | 1694 Optional[Variant[Hash, Array[Variant[Array,Hash]]]] $directories = undef, |
68 $modsec_audit_log_file = undef, | 1695 Boolean $error_log = true, |
69 $modsec_audit_log_pipe = undef, | 1696 $error_log_file = undef, |
70 $error_documents = [], | 1697 $error_log_pipe = undef, |
71 $fallbackresource = undef, | 1698 $error_log_syslog = undef, |
72 $scriptalias = undef, | 1699 Optional[Pattern[/^((Strict|Unsafe)?\s*(\b(Registered|Lenient)Methods)?\s*(\b(Allow0\.9|Require1\.0))?)$/]] $http_protocol_options = undef, |
73 $scriptaliases = [], | 1700 $modsec_audit_log = undef, |
74 $proxy_dest = undef, | 1701 $modsec_audit_log_file = undef, |
75 $proxy_dest_match = undef, | 1702 $modsec_audit_log_pipe = undef, |
76 $proxy_dest_reverse_match = undef, | 1703 $error_documents = [], |
77 $proxy_pass = undef, | 1704 Optional[Variant[Stdlib::Absolutepath, Enum['disabled']]] $fallbackresource = undef, |
78 $proxy_pass_match = undef, | 1705 $scriptalias = undef, |
79 $suphp_addhandler = $::apache::params::suphp_addhandler, | 1706 $scriptaliases = [], |
80 $suphp_engine = $::apache::params::suphp_engine, | 1707 $proxy_dest = undef, |
81 $suphp_configpath = $::apache::params::suphp_configpath, | 1708 $proxy_dest_match = undef, |
82 $php_flags = {}, | 1709 $proxy_dest_reverse_match = undef, |
83 $php_values = {}, | 1710 $proxy_pass = undef, |
84 $php_admin_flags = {}, | 1711 $proxy_pass_match = undef, |
85 $php_admin_values = {}, | 1712 Boolean $proxy_requests = false, |
86 $no_proxy_uris = [], | 1713 $suphp_addhandler = $::apache::params::suphp_addhandler, |
87 $no_proxy_uris_match = [], | 1714 Enum['on', 'off'] $suphp_engine = $::apache::params::suphp_engine, |
88 $proxy_preserve_host = false, | 1715 $suphp_configpath = $::apache::params::suphp_configpath, |
89 $proxy_add_headers = undef, | 1716 $php_flags = {}, |
90 $proxy_error_override = false, | 1717 $php_values = {}, |
91 $redirect_source = '/', | 1718 $php_admin_flags = {}, |
92 $redirect_dest = undef, | 1719 $php_admin_values = {}, |
93 $redirect_status = undef, | 1720 $no_proxy_uris = [], |
94 $redirectmatch_status = undef, | 1721 $no_proxy_uris_match = [], |
95 $redirectmatch_regexp = undef, | 1722 $proxy_preserve_host = false, |
96 $redirectmatch_dest = undef, | 1723 $proxy_add_headers = undef, |
97 $rack_base_uris = undef, | 1724 $proxy_error_override = false, |
98 $passenger_base_uris = undef, | 1725 $redirect_source = '/', |
99 $headers = undef, | 1726 $redirect_dest = undef, |
100 $request_headers = undef, | 1727 $redirect_status = undef, |
101 $filters = undef, | 1728 $redirectmatch_status = undef, |
102 $rewrites = undef, | 1729 $redirectmatch_regexp = undef, |
103 $rewrite_base = undef, | 1730 $redirectmatch_dest = undef, |
104 $rewrite_rule = undef, | 1731 $headers = undef, |
105 $rewrite_cond = undef, | 1732 $request_headers = undef, |
106 $rewrite_inherit = false, | 1733 $filters = undef, |
107 $setenv = [], | 1734 Optional[Array] $rewrites = undef, |
108 $setenvif = [], | 1735 $rewrite_base = undef, |
109 $setenvifnocase = [], | 1736 $rewrite_rule = undef, |
110 $block = [], | 1737 $rewrite_cond = undef, |
111 $ensure = 'present', | 1738 $rewrite_inherit = false, |
112 $wsgi_application_group = undef, | 1739 $setenv = [], |
113 $wsgi_daemon_process = undef, | 1740 $setenvif = [], |
114 $wsgi_daemon_process_options = undef, | 1741 $setenvifnocase = [], |
115 $wsgi_import_script = undef, | 1742 $block = [], |
116 $wsgi_import_script_options = undef, | 1743 Enum['absent', 'present'] $ensure = 'present', |
117 $wsgi_process_group = undef, | 1744 $wsgi_application_group = undef, |
118 $wsgi_script_aliases_match = undef, | 1745 Optional[Variant[String,Hash]] $wsgi_daemon_process = undef, |
119 $wsgi_script_aliases = undef, | 1746 Optional[Hash] $wsgi_daemon_process_options = undef, |
120 $wsgi_pass_authorization = undef, | 1747 $wsgi_import_script = undef, |
121 $wsgi_chunked_request = undef, | 1748 Optional[Hash] $wsgi_import_script_options = undef, |
122 $custom_fragment = undef, | 1749 $wsgi_process_group = undef, |
123 $itk = undef, | 1750 Optional[Hash] $wsgi_script_aliases_match = undef, |
124 $action = undef, | 1751 Optional[Hash] $wsgi_script_aliases = undef, |
125 $fastcgi_server = undef, | 1752 Optional[Enum['on', 'off', 'On', 'Off']] $wsgi_pass_authorization = undef, |
126 $fastcgi_socket = undef, | 1753 $wsgi_chunked_request = undef, |
127 $fastcgi_dir = undef, | 1754 Optional[String] $custom_fragment = undef, |
128 $fastcgi_idle_timeout = undef, | 1755 Optional[Hash] $itk = undef, |
129 $additional_includes = [], | 1756 $action = undef, |
130 $use_optional_includes = $::apache::use_optional_includes, | 1757 $fastcgi_server = undef, |
131 $apache_version = $::apache::apache_version, | 1758 $fastcgi_socket = undef, |
132 $allow_encoded_slashes = undef, | 1759 $fastcgi_dir = undef, |
133 $suexec_user_group = undef, | 1760 $fastcgi_idle_timeout = undef, |
134 $passenger_app_root = undef, | 1761 $additional_includes = [], |
135 $passenger_app_env = undef, | 1762 $use_optional_includes = $::apache::use_optional_includes, |
136 $passenger_ruby = undef, | 1763 $apache_version = $::apache::apache_version, |
137 $passenger_min_instances = undef, | 1764 Optional[Enum['on', 'off', 'nodecode']] $allow_encoded_slashes = undef, |
138 $passenger_start_timeout = undef, | 1765 Optional[Pattern[/^[\w-]+ [\w-]+$/]] $suexec_user_group = undef, |
139 $passenger_pre_start = undef, | 1766 |
140 $passenger_user = undef, | 1767 Optional[Boolean] $h2_copy_files = undef, |
141 $passenger_high_performance = undef, | 1768 Optional[Boolean] $h2_direct = undef, |
142 $passenger_nodejs = undef, | 1769 Optional[Boolean] $h2_early_hints = undef, |
143 $passenger_sticky_sessions = undef, | 1770 Optional[Integer] $h2_max_session_streams = undef, |
144 $passenger_startup_file = undef, | 1771 Optional[Boolean] $h2_modern_tls_only = undef, |
145 $add_default_charset = undef, | 1772 Optional[Boolean] $h2_push = undef, |
146 $modsec_disable_vhost = undef, | 1773 Optional[Integer] $h2_push_diary_size = undef, |
147 $modsec_disable_ids = undef, | 1774 Array[String] $h2_push_priority = [], |
148 $modsec_disable_ips = undef, | 1775 Array[String] $h2_push_resource = [], |
149 $modsec_disable_msgs = undef, | 1776 Optional[Boolean] $h2_serialize_headers = undef, |
150 $modsec_disable_tags = undef, | 1777 Optional[Integer] $h2_stream_max_mem_size = undef, |
151 $modsec_body_limit = undef, | 1778 Optional[Integer] $h2_tls_cool_down_secs = undef, |
152 $jk_mounts = undef, | 1779 Optional[Integer] $h2_tls_warm_up_size = undef, |
153 $auth_kerb = false, | 1780 Optional[Boolean] $h2_upgrade = undef, |
154 $krb_method_negotiate = 'on', | 1781 Optional[Integer] $h2_window_size = undef, |
155 $krb_method_k5passwd = 'on', | 1782 |
156 $krb_authoritative = 'on', | 1783 Optional[Boolean] $passenger_enabled = undef, |
157 $krb_auth_realms = [], | 1784 Optional[String] $passenger_base_uri = undef, |
158 $krb_5keytab = undef, | 1785 Optional[Stdlib::Absolutepath] $passenger_ruby = undef, |
159 $krb_local_user_mapping = undef, | 1786 Optional[Stdlib::Absolutepath] $passenger_python = undef, |
160 $krb_verify_kdc = 'on', | 1787 Optional[Stdlib::Absolutepath] $passenger_nodejs = undef, |
161 $krb_servicename = 'HTTP', | 1788 Optional[String] $passenger_meteor_app_settings = undef, |
162 $krb_save_credentials = 'off', | 1789 Optional[String] $passenger_app_env = undef, |
163 $keepalive = undef, | 1790 Optional[Stdlib::Absolutepath] $passenger_app_root = undef, |
164 $keepalive_timeout = undef, | 1791 Optional[String] $passenger_app_group_name = undef, |
165 $max_keepalive_requests = undef, | 1792 Optional[Enum['meteor', 'node', 'rack', 'wsgi']] $passenger_app_type = undef, |
166 $cas_attribute_prefix = undef, | 1793 Optional[String] $passenger_startup_file = undef, |
167 $cas_attribute_delimiter = undef, | 1794 Optional[String] $passenger_restart_dir = undef, |
168 $cas_scrub_request_headers = undef, | 1795 Optional[Enum['direct', 'smart']] $passenger_spawn_method = undef, |
169 $cas_sso_enabled = undef, | 1796 Optional[Boolean] $passenger_load_shell_envvars = undef, |
170 $cas_login_url = undef, | 1797 Optional[Boolean] $passenger_rolling_restarts = undef, |
171 $cas_validate_url = undef, | 1798 Optional[Boolean] $passenger_resist_deployment_errors = undef, |
172 $cas_validate_saml = undef, | 1799 Optional[String] $passenger_user = undef, |
1800 Optional[String] $passenger_group = undef, | |
1801 Optional[Boolean] $passenger_friendly_error_pages = undef, | |
1802 Optional[Integer] $passenger_min_instances = undef, | |
1803 Optional[Integer] $passenger_max_instances = undef, | |
1804 Optional[Integer] $passenger_max_preloader_idle_time = undef, | |
1805 Optional[Integer] $passenger_force_max_concurrent_requests_per_process = undef, | |
1806 Optional[Integer] $passenger_start_timeout = undef, | |
1807 Optional[Enum['process', 'thread']] $passenger_concurrency_model = undef, | |
1808 Optional[Integer] $passenger_thread_count = undef, | |
1809 Optional[Integer] $passenger_max_requests = undef, | |
1810 Optional[Integer] $passenger_max_request_time = undef, | |
1811 Optional[Integer] $passenger_memory_limit = undef, | |
1812 Optional[Integer] $passenger_stat_throttle_rate = undef, | |
1813 Optional[Variant[String,Array[String]]] $passenger_pre_start = undef, | |
1814 Optional[Boolean] $passenger_high_performance = undef, | |
1815 Optional[Boolean] $passenger_buffer_upload = undef, | |
1816 Optional[Boolean] $passenger_buffer_response = undef, | |
1817 Optional[Boolean] $passenger_error_override = undef, | |
1818 Optional[Integer] $passenger_max_request_queue_size = undef, | |
1819 Optional[Integer] $passenger_max_request_queue_time = undef, | |
1820 Optional[Boolean] $passenger_sticky_sessions = undef, | |
1821 Optional[String] $passenger_sticky_sessions_cookie_name = undef, | |
1822 Optional[Boolean] $passenger_allow_encoded_slashes = undef, | |
1823 Optional[Boolean] $passenger_debugger = undef, | |
1824 Optional[Integer] $passenger_lve_min_uid = undef, | |
1825 $add_default_charset = undef, | |
1826 $modsec_disable_vhost = undef, | |
1827 Optional[Variant[Hash, Array]] $modsec_disable_ids = undef, | |
1828 $modsec_disable_ips = undef, | |
1829 Optional[Variant[Hash, Array]] $modsec_disable_msgs = undef, | |
1830 Optional[Variant[Hash, Array]] $modsec_disable_tags = undef, | |
1831 $modsec_body_limit = undef, | |
1832 $jk_mounts = undef, | |
1833 Boolean $auth_kerb = false, | |
1834 $krb_method_negotiate = 'on', | |
1835 $krb_method_k5passwd = 'on', | |
1836 $krb_authoritative = 'on', | |
1837 $krb_auth_realms = [], | |
1838 $krb_5keytab = undef, | |
1839 $krb_local_user_mapping = undef, | |
1840 $krb_verify_kdc = 'on', | |
1841 $krb_servicename = 'HTTP', | |
1842 $krb_save_credentials = 'off', | |
1843 Optional[Enum['on', 'off']] $keepalive = undef, | |
1844 $keepalive_timeout = undef, | |
1845 $max_keepalive_requests = undef, | |
1846 $cas_attribute_prefix = undef, | |
1847 $cas_attribute_delimiter = undef, | |
1848 $cas_root_proxied_as = undef, | |
1849 $cas_scrub_request_headers = undef, | |
1850 $cas_sso_enabled = undef, | |
1851 $cas_login_url = undef, | |
1852 $cas_validate_url = undef, | |
1853 $cas_validate_saml = undef, | |
1854 Optional[String] $shib_compat_valid_user = undef, | |
1855 Optional[Enum['On', 'on', 'Off', 'off', 'DNS', 'dns']] $use_canonical_name = undef, | |
1856 Optional[Variant[String,Array[String]]] $comment = undef, | |
1857 Hash $define = {}, | |
173 ) { | 1858 ) { |
1859 | |
174 # The base class must be included first because it is used by parameter defaults | 1860 # The base class must be included first because it is used by parameter defaults |
175 if ! defined(Class['apache']) { | 1861 if ! defined(Class['apache']) { |
176 fail('You must include the apache base class before using any apache defined resources') | 1862 fail('You must include the apache base class before using any apache defined resources') |
177 } | 1863 } |
178 | 1864 |
179 $apache_name = $::apache::apache_name | 1865 $apache_name = $::apache::apache_name |
180 | 1866 |
181 validate_re($ensure, '^(present|absent)$', | |
182 "${ensure} is not supported for ensure. | |
183 Allowed values are 'present' and 'absent'.") | |
184 validate_re($suphp_engine, '^(on|off)$', | |
185 "${suphp_engine} is not supported for suphp_engine. | |
186 Allowed values are 'on' and 'off'.") | |
187 validate_bool($ip_based) | |
188 validate_bool($access_log) | |
189 validate_bool($error_log) | |
190 if $modsec_audit_log != undef { | |
191 validate_bool($modsec_audit_log) | |
192 } | |
193 validate_bool($ssl) | |
194 validate_bool($default_vhost) | |
195 validate_bool($ssl_proxyengine) | |
196 if $ssl_stapling != undef { | |
197 validate_bool($ssl_stapling) | |
198 } | |
199 if $rewrites { | 1867 if $rewrites { |
200 validate_array($rewrites) | |
201 unless empty($rewrites) { | 1868 unless empty($rewrites) { |
202 $rewrites_flattened = delete_undef_values(flatten([$rewrites])) | 1869 $rewrites_flattened = delete_undef_values(flatten([$rewrites])) |
203 validate_hash($rewrites_flattened[0]) | 1870 assert_type(Array[Hash], $rewrites_flattened) |
204 } | 1871 } |
205 } | 1872 } |
206 | 1873 |
207 # Input validation begins | 1874 # Input validation begins |
208 | 1875 |
209 if $suexec_user_group { | |
210 validate_re($suexec_user_group, '^[\w-]+ [\w-]+$', | |
211 "${suexec_user_group} is not supported for suexec_user_group. Must be 'user group'.") | |
212 } | |
213 | |
214 if $wsgi_pass_authorization { | |
215 validate_re(downcase($wsgi_pass_authorization), '^(on|off)$', | |
216 "${wsgi_pass_authorization} is not supported for wsgi_pass_authorization. | |
217 Allowed values are 'on' and 'off'.") | |
218 } | |
219 | |
220 if $wsgi_chunked_request { | |
221 validate_re(downcase($wsgi_chunked_request), '^(on|off)$', | |
222 "${wsgi_chunked_request} is not supported for wsgi_chunked_request. | |
223 Allowed values are 'on' and 'off'.") | |
224 } | |
225 | |
226 # Deprecated backwards-compatibility | |
227 if $rewrite_base { | |
228 warning('Apache::Vhost: parameter rewrite_base is deprecated in favor of rewrites') | |
229 } | |
230 if $rewrite_rule { | |
231 warning('Apache::Vhost: parameter rewrite_rule is deprecated in favor of rewrites') | |
232 } | |
233 if $rewrite_cond { | |
234 warning('Apache::Vhost parameter rewrite_cond is deprecated in favor of rewrites') | |
235 } | |
236 | |
237 if $wsgi_script_aliases { | |
238 validate_hash($wsgi_script_aliases) | |
239 } | |
240 if $wsgi_script_aliases_match { | |
241 validate_hash($wsgi_script_aliases_match) | |
242 } | |
243 if $wsgi_daemon_process_options { | |
244 validate_hash($wsgi_daemon_process_options) | |
245 } | |
246 if $wsgi_import_script_options { | |
247 validate_hash($wsgi_import_script_options) | |
248 } | |
249 if $itk { | |
250 validate_hash($itk) | |
251 } | |
252 | |
253 validate_re($logroot_ensure, '^(directory|absent)$', | |
254 "${logroot_ensure} is not supported for logroot_ensure. | |
255 Allowed values are 'directory' and 'absent'.") | |
256 | |
257 if $log_level { | 1876 if $log_level { |
258 validate_apache_log_level($log_level) | 1877 apache::validate_apache_log_level($log_level) |
259 } | 1878 } |
260 | 1879 |
261 if $access_log_file and $access_log_pipe { | 1880 if $access_log_file and $access_log_pipe { |
262 fail("Apache::Vhost[${name}]: 'access_log_file' and 'access_log_pipe' cannot be defined at the same time") | 1881 fail("Apache::Vhost[${name}]: 'access_log_file' and 'access_log_pipe' cannot be defined at the same time") |
263 } | 1882 } |
266 fail("Apache::Vhost[${name}]: 'error_log_file' and 'error_log_pipe' cannot be defined at the same time") | 1885 fail("Apache::Vhost[${name}]: 'error_log_file' and 'error_log_pipe' cannot be defined at the same time") |
267 } | 1886 } |
268 | 1887 |
269 if $modsec_audit_log_file and $modsec_audit_log_pipe { | 1888 if $modsec_audit_log_file and $modsec_audit_log_pipe { |
270 fail("Apache::Vhost[${name}]: 'modsec_audit_log_file' and 'modsec_audit_log_pipe' cannot be defined at the same time") | 1889 fail("Apache::Vhost[${name}]: 'modsec_audit_log_file' and 'modsec_audit_log_pipe' cannot be defined at the same time") |
271 } | |
272 | |
273 if $fallbackresource { | |
274 validate_re($fallbackresource, '^/|disabled', 'Please make sure fallbackresource starts with a / (or is "disabled")') | |
275 } | |
276 | |
277 if $custom_fragment { | |
278 validate_string($custom_fragment) | |
279 } | |
280 | |
281 if $allow_encoded_slashes { | |
282 validate_re($allow_encoded_slashes, '(^on$|^off$|^nodecode$)', "${allow_encoded_slashes} is not permitted for allow_encoded_slashes. Allowed values are 'on', 'off' or 'nodecode'.") | |
283 } | |
284 | |
285 validate_bool($auth_kerb) | |
286 | |
287 # Validate the docroot as a string if: | |
288 # - $manage_docroot is true | |
289 if $manage_docroot { | |
290 validate_string($docroot) | |
291 } | |
292 | |
293 if $ssl_proxy_verify { | |
294 validate_re($ssl_proxy_verify,'^(none|optional|require|optional_no_ca)$',"${ssl_proxy_verify} is not permitted for ssl_proxy_verify. Allowed values are 'none', 'optional', 'require' or 'optional_no_ca'.") | |
295 } | |
296 | |
297 if $ssl_proxy_check_peer_cn { | |
298 validate_re($ssl_proxy_check_peer_cn,'(^on$|^off$)',"${ssl_proxy_check_peer_cn} is not permitted for ssl_proxy_check_peer_cn. Allowed values are 'on' or 'off'.") | |
299 } | |
300 if $ssl_proxy_check_peer_name { | |
301 validate_re($ssl_proxy_check_peer_name,'(^on$|^off$)',"${ssl_proxy_check_peer_name} is not permitted for ssl_proxy_check_peer_name. Allowed values are 'on' or 'off'.") | |
302 } | |
303 | |
304 if $ssl_proxy_check_peer_expire { | |
305 validate_re($ssl_proxy_check_peer_expire,'(^on$|^off$)',"${ssl_proxy_check_peer_expire} is not permitted for ssl_proxy_check_peer_expire. Allowed values are 'on' or 'off'.") | |
306 } | |
307 | |
308 if $keepalive { | |
309 validate_re($keepalive,'(^on$|^off$)',"${keepalive} is not permitted for keepalive. Allowed values are 'on' or 'off'.") | |
310 } | |
311 | |
312 if $passenger_sticky_sessions { | |
313 validate_bool($passenger_sticky_sessions) | |
314 } | 1890 } |
315 | 1891 |
316 # Input validation ends | 1892 # Input validation ends |
317 | 1893 |
318 if $ssl and $ensure == 'present' { | 1894 if $ssl and $ensure == 'present' { |
327 | 1903 |
328 if $virtual_docroot { | 1904 if $virtual_docroot { |
329 include ::apache::mod::vhost_alias | 1905 include ::apache::mod::vhost_alias |
330 } | 1906 } |
331 | 1907 |
332 if $wsgi_daemon_process { | 1908 if $wsgi_application_group or $wsgi_daemon_process or ($wsgi_import_script and $wsgi_import_script_options) or $wsgi_process_group or ($wsgi_script_aliases and ! empty($wsgi_script_aliases)) or $wsgi_pass_authorization { |
333 include ::apache::mod::wsgi | 1909 include ::apache::mod::wsgi |
334 } | 1910 } |
335 | 1911 |
336 if $suexec_user_group { | 1912 if $suexec_user_group { |
337 include ::apache::mod::suexec | 1913 include ::apache::mod::suexec |
338 } | 1914 } |
339 | 1915 |
340 if $passenger_app_root or $passenger_app_env or $passenger_ruby or $passenger_min_instances or $passenger_start_timeout or $passenger_pre_start or $passenger_user or $passenger_high_performance or $passenger_nodejs or $passenger_sticky_sessions or $passenger_startup_file { | 1916 if $passenger_spawn_method or $passenger_app_root or $passenger_app_env or $passenger_ruby or $passenger_min_instances or $passenger_max_requests or $passenger_start_timeout or $passenger_pre_start or $passenger_user or $passenger_group or $passenger_high_performance or $passenger_nodejs or $passenger_sticky_sessions or $passenger_startup_file { |
341 include ::apache::mod::passenger | 1917 include ::apache::mod::passenger |
342 } | 1918 } |
343 | 1919 |
344 # Configure the defaultness of a vhost | 1920 # Configure the defaultness of a vhost |
345 if $priority { | 1921 if $priority { |
375 owner => $logroot_owner, | 1951 owner => $logroot_owner, |
376 group => $logroot_group, | 1952 group => $logroot_group, |
377 mode => $logroot_mode, | 1953 mode => $logroot_mode, |
378 require => Package['httpd'], | 1954 require => Package['httpd'], |
379 before => Concat["${priority_real}${filename}.conf"], | 1955 before => Concat["${priority_real}${filename}.conf"], |
380 } | 1956 notify => Class['Apache::Service'], |
381 } | 1957 } |
382 | 1958 } |
383 | |
384 # Is apache::mod::passenger enabled (or apache::mod['passenger']) | |
385 $passenger_enabled = defined(Apache::Mod['passenger']) | |
386 | 1959 |
387 # Is apache::mod::shib enabled (or apache::mod['shib2']) | 1960 # Is apache::mod::shib enabled (or apache::mod['shib2']) |
388 $shibboleth_enabled = defined(Apache::Mod['shib2']) | 1961 $shibboleth_enabled = defined(Apache::Mod['shib2']) |
389 | 1962 |
390 # Is apache::mod::cas enabled (or apache::mod['cas']) | 1963 # Is apache::mod::cas enabled (or apache::mod['cas']) |
391 $cas_enabled = defined(Apache::Mod['auth_cas']) | 1964 $cas_enabled = defined(Apache::Mod['auth_cas']) |
392 | 1965 |
393 if $access_log and !$access_logs { | 1966 if $access_log and !$access_logs { |
394 if $access_log_file { | |
395 $_logs_dest = "${logroot}/${access_log_file}" | |
396 } elsif $access_log_pipe { | |
397 $_logs_dest = $access_log_pipe | |
398 } elsif $access_log_syslog { | |
399 $_logs_dest = $access_log_syslog | |
400 } else { | |
401 $_logs_dest = undef | |
402 } | |
403 $_access_logs = [{ | 1967 $_access_logs = [{ |
404 'file' => $access_log_file, | 1968 'file' => $access_log_file, |
405 'pipe' => $access_log_pipe, | 1969 'pipe' => $access_log_pipe, |
406 'syslog' => $access_log_syslog, | 1970 'syslog' => $access_log_syslog, |
407 'format' => $access_log_format, | 1971 'format' => $access_log_format, |
408 'env' => $access_log_env_var | 1972 'env' => $access_log_env_var |
409 }] | 1973 }] |
410 } elsif $access_logs { | 1974 } elsif $access_logs { |
411 if !is_array($access_logs) { | |
412 fail("Apache::Vhost[${name}]: access_logs must be an array of hashes") | |
413 } | |
414 $_access_logs = $access_logs | 1975 $_access_logs = $access_logs |
415 } | 1976 } |
416 | 1977 |
417 if $error_log_file { | 1978 if $error_log_file { |
418 $error_log_destination = "${logroot}/${error_log_file}" | 1979 if $error_log_file =~ /^\// { |
1980 # Absolute path provided - don't prepend $logroot | |
1981 $error_log_destination = $error_log_file | |
1982 } else { | |
1983 $error_log_destination = "${logroot}/${error_log_file}" | |
1984 } | |
419 } elsif $error_log_pipe { | 1985 } elsif $error_log_pipe { |
420 $error_log_destination = $error_log_pipe | 1986 $error_log_destination = $error_log_pipe |
421 } elsif $error_log_syslog { | 1987 } elsif $error_log_syslog { |
422 $error_log_destination = $error_log_syslog | 1988 $error_log_destination = $error_log_syslog |
423 } else { | 1989 } else { |
444 $modsec_audit_log_destination = undef | 2010 $modsec_audit_log_destination = undef |
445 } | 2011 } |
446 | 2012 |
447 | 2013 |
448 if $ip { | 2014 if $ip { |
449 $_ip = enclose_ipv6($ip) | 2015 $_ip = any2array(enclose_ipv6($ip)) |
450 if $port { | 2016 if $port { |
451 $listen_addr_port = suffix(any2array($_ip),":${port}") | 2017 $_port = any2array($port) |
452 $nvh_addr_port = suffix(any2array($_ip),":${port}") | 2018 $listen_addr_port = split(inline_template("<%= @_ip.product(@_port).map {|x| x.join(':') }.join(',')%>"), ',') |
2019 $nvh_addr_port = split(inline_template("<%= @_ip.product(@_port).map {|x| x.join(':') }.join(',')%>"), ',') | |
453 } else { | 2020 } else { |
454 $listen_addr_port = undef | 2021 $listen_addr_port = undef |
455 $nvh_addr_port = $_ip | 2022 $nvh_addr_port = $_ip |
456 if ! $servername and ! $ip_based { | 2023 if ! $servername and ! $ip_based { |
457 fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters for name-based vhosts") | 2024 fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters for name-based vhosts") |
458 } | 2025 } |
459 } | 2026 } |
460 } else { | 2027 } else { |
461 if $port { | 2028 if $port { |
462 $listen_addr_port = $port | 2029 $listen_addr_port = $port |
463 $nvh_addr_port = "${vhost_name}:${port}" | 2030 $nvh_addr_port = prefix(any2array($port),"${vhost_name}:") |
464 } else { | 2031 } else { |
465 $listen_addr_port = undef | 2032 $listen_addr_port = undef |
466 $nvh_addr_port = $name | 2033 $nvh_addr_port = $name |
467 if ! $servername and $servername != '' { | 2034 if ! $servername and $servername != '' { |
468 fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters, and/or 'servername' parameter") | 2035 fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters, and/or 'servername' parameter") |
469 } | 2036 } |
470 } | 2037 } |
471 } | 2038 } |
2039 | |
472 if $add_listen { | 2040 if $add_listen { |
473 if $ip and defined(Apache::Listen["${port}"]) { | 2041 if $ip and defined(Apache::Listen[String($port)]) { |
474 fail("Apache::Vhost[${name}]: Mixing IP and non-IP Listen directives is not possible; check the add_listen parameter of the apache::vhost define to disable this") | 2042 fail("Apache::Vhost[${name}]: Mixing IP and non-IP Listen directives is not possible; check the add_listen parameter of the apache::vhost define to disable this") |
475 } | 2043 } |
476 if $listen_addr_port and $ensure == 'present' { | 2044 if $listen_addr_port and $ensure == 'present' { |
477 ensure_resource('apache::listen', $listen_addr_port) | 2045 ensure_resource('apache::listen', $listen_addr_port) |
478 } | 2046 } |
489 include ::apache::mod::rewrite | 2057 include ::apache::mod::rewrite |
490 } | 2058 } |
491 } | 2059 } |
492 | 2060 |
493 # Load mod_alias if needed and not yet loaded | 2061 # Load mod_alias if needed and not yet loaded |
494 if ($scriptalias or $scriptaliases != []) or ($aliases and $aliases != []) or ($redirect_source and $redirect_dest) { | 2062 if ($scriptalias or $scriptaliases != []) |
2063 or ($aliases and $aliases != []) | |
2064 or ($redirect_source and $redirect_dest) | |
2065 or ($redirectmatch_regexp or $redirectmatch_status or $redirectmatch_dest){ | |
495 if ! defined(Class['apache::mod::alias']) and ($ensure == 'present') { | 2066 if ! defined(Class['apache::mod::alias']) and ($ensure == 'present') { |
496 include ::apache::mod::alias | 2067 include ::apache::mod::alias |
497 } | 2068 } |
498 } | 2069 } |
499 | 2070 |
505 if ! defined(Class['apache::mod::proxy_http']) { | 2076 if ! defined(Class['apache::mod::proxy_http']) { |
506 include ::apache::mod::proxy_http | 2077 include ::apache::mod::proxy_http |
507 } | 2078 } |
508 } | 2079 } |
509 | 2080 |
510 # Load mod_passenger if needed and not yet loaded | 2081 # Load mod_fastcgi if needed and not yet loaded |
511 if $rack_base_uris { | |
512 if ! defined(Class['apache::mod::passenger']) { | |
513 include ::apache::mod::passenger | |
514 } | |
515 } | |
516 | |
517 # Load mod_passenger if needed and not yet loaded | |
518 if $passenger_base_uris { | |
519 include ::apache::mod::passenger | |
520 } | |
521 | |
522 # Load mod_fastci if needed and not yet loaded | |
523 if $fastcgi_server and $fastcgi_socket { | 2082 if $fastcgi_server and $fastcgi_socket { |
524 if ! defined(Class['apache::mod::fastcgi']) { | 2083 if ! defined(Class['apache::mod::fastcgi']) { |
525 include ::apache::mod::fastcgi | 2084 include ::apache::mod::fastcgi |
526 } | 2085 } |
527 } | 2086 } |
558 } | 2117 } |
559 } | 2118 } |
560 | 2119 |
561 ## Create a default directory list if none defined | 2120 ## Create a default directory list if none defined |
562 if $directories { | 2121 if $directories { |
563 if !is_hash($directories) and !(is_array($directories) and is_hash($directories[0])) { | |
564 fail("Apache::Vhost[${name}]: 'directories' must be either a Hash or an Array of Hashes") | |
565 } | |
566 $_directories = $directories | 2122 $_directories = $directories |
567 } elsif $docroot { | 2123 } elsif $docroot { |
568 $_directory = { | 2124 $_directory = { |
569 provider => 'directory', | 2125 provider => 'directory', |
570 path => $docroot, | 2126 path => $docroot, |
589 $_directories = undef | 2145 $_directories = undef |
590 } | 2146 } |
591 | 2147 |
592 ## Create a global LocationMatch if locations aren't defined | 2148 ## Create a global LocationMatch if locations aren't defined |
593 if $modsec_disable_ids { | 2149 if $modsec_disable_ids { |
594 if is_hash($modsec_disable_ids) { | 2150 if $modsec_disable_ids =~ Array { |
595 $_modsec_disable_ids = $modsec_disable_ids | |
596 } elsif is_array($modsec_disable_ids) { | |
597 $_modsec_disable_ids = { '.*' => $modsec_disable_ids } | 2151 $_modsec_disable_ids = { '.*' => $modsec_disable_ids } |
598 } else { | 2152 } else { |
599 fail("Apache::Vhost[${name}]: 'modsec_disable_ids' must be either a Hash of location/IDs or an Array of IDs") | 2153 $_modsec_disable_ids = $modsec_disable_ids |
600 } | 2154 } |
601 } | 2155 } |
602 | 2156 |
603 if $modsec_disable_msgs { | 2157 if $modsec_disable_msgs { |
604 if is_hash($modsec_disable_msgs) { | 2158 if $modsec_disable_msgs =~ Array { |
605 $_modsec_disable_msgs = $modsec_disable_msgs | |
606 } elsif is_array($modsec_disable_msgs) { | |
607 $_modsec_disable_msgs = { '.*' => $modsec_disable_msgs } | 2159 $_modsec_disable_msgs = { '.*' => $modsec_disable_msgs } |
608 } else { | 2160 } else { |
609 fail("Apache::Vhost[${name}]: 'modsec_disable_msgs' must be either a Hash of location/Msgs or an Array of Msgs") | 2161 $_modsec_disable_msgs = $modsec_disable_msgs |
610 } | 2162 } |
611 } | 2163 } |
612 | 2164 |
613 if $modsec_disable_tags { | 2165 if $modsec_disable_tags { |
614 if is_hash($modsec_disable_tags) { | 2166 if $modsec_disable_tags =~ Array { |
615 $_modsec_disable_tags = $modsec_disable_tags | |
616 } elsif is_array($modsec_disable_tags) { | |
617 $_modsec_disable_tags = { '.*' => $modsec_disable_tags } | 2167 $_modsec_disable_tags = { '.*' => $modsec_disable_tags } |
618 } else { | 2168 } else { |
619 fail("Apache::Vhost[${name}]: 'modsec_disable_tags' must be either a Hash of location/Tags or an Array of Tags") | 2169 $_modsec_disable_tags = $modsec_disable_tags |
620 } | 2170 } |
621 } | 2171 } |
622 | 2172 |
623 concat { "${priority_real}${filename}.conf": | 2173 concat { "${priority_real}${filename}.conf": |
624 ensure => $ensure, | 2174 ensure => $ensure, |
649 notify => Class['apache::service'], | 2199 notify => Class['apache::service'], |
650 } | 2200 } |
651 } | 2201 } |
652 | 2202 |
653 # Template uses: | 2203 # Template uses: |
2204 # - $comment | |
654 # - $nvh_addr_port | 2205 # - $nvh_addr_port |
655 # - $servername | 2206 # - $servername |
656 # - $serveradmin | 2207 # - $serveradmin |
2208 # - $protocols | |
2209 # - $protocols_honor_order | |
2210 # - $apache_version | |
657 concat::fragment { "${name}-apache-header": | 2211 concat::fragment { "${name}-apache-header": |
658 target => "${priority_real}${filename}.conf", | 2212 target => "${priority_real}${filename}.conf", |
659 order => 0, | 2213 order => 0, |
660 content => template('apache/vhost/_file_header.erb'), | 2214 content => template('apache/vhost/_file_header.erb'), |
661 } | 2215 } |
827 # - $proxy_pass | 2381 # - $proxy_pass |
828 # - $proxy_pass_match | 2382 # - $proxy_pass_match |
829 # - $proxy_preserve_host | 2383 # - $proxy_preserve_host |
830 # - $proxy_add_headers | 2384 # - $proxy_add_headers |
831 # - $no_proxy_uris | 2385 # - $no_proxy_uris |
832 if $proxy_dest or $proxy_pass or $proxy_pass_match or $proxy_dest_match { | 2386 if $proxy_dest or $proxy_pass or $proxy_pass_match or $proxy_dest_match or $proxy_preserve_host { |
833 concat::fragment { "${name}-proxy": | 2387 concat::fragment { "${name}-proxy": |
834 target => "${priority_real}${filename}.conf", | 2388 target => "${priority_real}${filename}.conf", |
835 order => 160, | 2389 order => 160, |
836 content => template('apache/vhost/_proxy.erb'), | 2390 content => template('apache/vhost/_proxy.erb'), |
837 } | |
838 } | |
839 | |
840 # Template uses: | |
841 # - $rack_base_uris | |
842 if $rack_base_uris { | |
843 concat::fragment { "${name}-rack": | |
844 target => "${priority_real}${filename}.conf", | |
845 order => 170, | |
846 content => template('apache/vhost/_rack.erb'), | |
847 } | |
848 } | |
849 | |
850 # Template uses: | |
851 # - $passenger_base_uris | |
852 if $passenger_base_uris { | |
853 concat::fragment { "${name}-passenger_uris": | |
854 target => "${priority_real}${filename}.conf", | |
855 order => 175, | |
856 content => template('apache/vhost/_passenger_base_uris.erb'), | |
857 } | 2391 } |
858 } | 2392 } |
859 | 2393 |
860 # Template uses: | 2394 # Template uses: |
861 # - $redirect_source | 2395 # - $redirect_source |
952 } | 2486 } |
953 | 2487 |
954 # Template uses: | 2488 # Template uses: |
955 # - $ssl_proxyengine | 2489 # - $ssl_proxyengine |
956 # - $ssl_proxy_verify | 2490 # - $ssl_proxy_verify |
2491 # - $ssl_proxy_verify_depth | |
2492 # - $ssl_proxy_ca_cert | |
957 # - $ssl_proxy_check_peer_cn | 2493 # - $ssl_proxy_check_peer_cn |
958 # - $ssl_proxy_check_peer_name | 2494 # - $ssl_proxy_check_peer_name |
959 # - $ssl_proxy_check_peer_expire | 2495 # - $ssl_proxy_check_peer_expire |
960 # - $ssl_proxy_machine_cert | 2496 # - $ssl_proxy_machine_cert |
961 # - $ssl_proxy_protocol | 2497 # - $ssl_proxy_protocol |
1024 # - $wsgi_import_script | 2560 # - $wsgi_import_script |
1025 # - $wsgi_import_script_options | 2561 # - $wsgi_import_script_options |
1026 # - $wsgi_process_group | 2562 # - $wsgi_process_group |
1027 # - $wsgi_script_aliases | 2563 # - $wsgi_script_aliases |
1028 # - $wsgi_pass_authorization | 2564 # - $wsgi_pass_authorization |
2565 if $wsgi_daemon_process_options { | |
2566 deprecation('apache::vhost::wsgi_daemon_process_options', 'This parameter is deprecated. Please add values inside Hash `wsgi_daemon_process`.') | |
2567 } | |
1029 if $wsgi_application_group or $wsgi_daemon_process or ($wsgi_import_script and $wsgi_import_script_options) or $wsgi_process_group or ($wsgi_script_aliases and ! empty($wsgi_script_aliases)) or $wsgi_pass_authorization { | 2568 if $wsgi_application_group or $wsgi_daemon_process or ($wsgi_import_script and $wsgi_import_script_options) or $wsgi_process_group or ($wsgi_script_aliases and ! empty($wsgi_script_aliases)) or $wsgi_pass_authorization { |
1030 concat::fragment { "${name}-wsgi": | 2569 concat::fragment { "${name}-wsgi": |
1031 target => "${priority_real}${filename}.conf", | 2570 target => "${priority_real}${filename}.conf", |
1032 order => 260, | 2571 order => 260, |
1033 content => template('apache/vhost/_wsgi.erb'), | 2572 content => template('apache/vhost/_wsgi.erb'), |
1066 order => 290, | 2605 order => 290, |
1067 content => template('apache/vhost/_suexec.erb'), | 2606 content => template('apache/vhost/_suexec.erb'), |
1068 } | 2607 } |
1069 } | 2608 } |
1070 | 2609 |
1071 # Template uses: | 2610 if $h2_copy_files != undef or $h2_direct != undef or $h2_early_hints != undef or $h2_max_session_streams != undef or $h2_modern_tls_only != undef or $h2_push != undef or $h2_push_diary_size != undef or $h2_push_priority != [] or $h2_push_resource != [] or $h2_serialize_headers != undef or $h2_stream_max_mem_size != undef or $h2_tls_cool_down_secs != undef or $h2_tls_warm_up_size != undef or $h2_upgrade != undef or $h2_window_size != undef { |
2611 include ::apache::mod::http2 | |
2612 | |
2613 concat::fragment { "${name}-http2": | |
2614 target => "${priority_real}${filename}.conf", | |
2615 order => 300, | |
2616 content => template('apache/vhost/_http2.erb'), | |
2617 } | |
2618 } | |
2619 | |
2620 # Template uses: | |
2621 # - $passenger_spawn_method | |
1072 # - $passenger_app_root | 2622 # - $passenger_app_root |
1073 # - $passenger_app_env | 2623 # - $passenger_app_env |
1074 # - $passenger_ruby | 2624 # - $passenger_ruby |
1075 # - $passenger_min_instances | 2625 # - $passenger_min_instances |
2626 # - $passenger_max_requests | |
1076 # - $passenger_start_timeout | 2627 # - $passenger_start_timeout |
1077 # - $passenger_pre_start | |
1078 # - $passenger_user | 2628 # - $passenger_user |
2629 # - $passenger_group | |
1079 # - $passenger_nodejs | 2630 # - $passenger_nodejs |
1080 # - $passenger_sticky_sessions | 2631 # - $passenger_sticky_sessions |
1081 # - $passenger_startup_file | 2632 # - $passenger_startup_file |
1082 if $passenger_app_root or $passenger_app_env or $passenger_ruby or $passenger_min_instances or $passenger_start_timeout or $passenger_pre_start or $passenger_user or $passenger_nodejs or $passenger_sticky_sessions or $passenger_startup_file{ | 2633 if $passenger_spawn_method or $passenger_app_root or $passenger_app_env or $passenger_ruby or $passenger_min_instances or $passenger_start_timeout or $passenger_user or $passenger_group or $passenger_nodejs or $passenger_sticky_sessions or $passenger_startup_file{ |
1083 concat::fragment { "${name}-passenger": | 2634 concat::fragment { "${name}-passenger": |
1084 target => "${priority_real}${filename}.conf", | 2635 target => "${priority_real}${filename}.conf", |
1085 order => 300, | 2636 order => 300, |
1086 content => template('apache/vhost/_passenger.erb'), | 2637 content => template('apache/vhost/_passenger.erb'), |
1087 } | 2638 } |
1153 order => 350, | 2704 order => 350, |
1154 content => template('apache/vhost/_auth_cas.erb'), | 2705 content => template('apache/vhost/_auth_cas.erb'), |
1155 } | 2706 } |
1156 } | 2707 } |
1157 | 2708 |
2709 # Template uses: | |
2710 # - $http_protocol_options | |
2711 if $http_protocol_options { | |
2712 concat::fragment { "${name}-http_protocol_options": | |
2713 target => "${priority_real}${filename}.conf", | |
2714 order => 350, | |
2715 content => template('apache/vhost/_http_protocol_options.erb'), | |
2716 } | |
2717 } | |
2718 | |
2719 # Template uses: | |
2720 # - $shib_compat_valid_user | |
2721 if $shibboleth_enabled { | |
2722 concat::fragment { "${name}-shibboleth": | |
2723 target => "${priority_real}${filename}.conf", | |
2724 order => 370, | |
2725 content => template('apache/vhost/_shib.erb'), | |
2726 } | |
2727 } | |
2728 | |
2729 # - $use_canonical_name | |
2730 if $use_canonical_name { | |
2731 concat::fragment { "${name}-use_canonical_name": | |
2732 target => "${priority_real}${filename}.conf", | |
2733 order => 360, | |
2734 content => template('apache/vhost/_use_canonical_name.erb'), | |
2735 } | |
2736 } | |
2737 | |
1158 # Template uses no variables | 2738 # Template uses no variables |
1159 concat::fragment { "${name}-file_footer": | 2739 concat::fragment { "${name}-file_footer": |
1160 target => "${priority_real}${filename}.conf", | 2740 target => "${priority_real}${filename}.conf", |
1161 order => 999, | 2741 order => 999, |
1162 content => template('apache/vhost/_file_footer.erb'), | 2742 content => template('apache/vhost/_file_footer.erb'), |