From 31a137bcb490e6a9041959e8f7115dceac91d4c0 Mon Sep 17 00:00:00 2001 From: Dinesh Gujar Date: Thu, 7 Sep 2023 13:17:34 +0530 Subject: [PATCH] CAT-1347 erb to epp conversion --- manifests/vhost.pp | 415 +++++++++++---------- templates/vhost/_action.epp | 4 + templates/vhost/_action.erb | 4 - templates/vhost/_aliases.epp | 14 + templates/vhost/_aliases.erb | 14 - templates/vhost/_allow_encoded_slashes.epp | 4 + templates/vhost/_allow_encoded_slashes.erb | 4 - templates/vhost/_auth_cas.epp | 65 ++++ templates/vhost/_auth_cas.erb | 65 ---- templates/vhost/_charsets.epp | 4 + templates/vhost/_charsets.erb | 4 - templates/vhost/_custom_fragment.epp | 5 + templates/vhost/_custom_fragment.erb | 5 - templates/vhost/_docroot.epp | 8 + templates/vhost/_docroot.erb | 8 - templates/vhost/_fallbackresource.epp | 4 + templates/vhost/_fallbackresource.erb | 4 - templates/vhost/_file_footer.epp | 9 + templates/vhost/_file_footer.erb | 9 - templates/vhost/_file_header.epp | 43 +++ templates/vhost/_file_header.erb | 42 --- templates/vhost/_filters.epp | 8 + templates/vhost/_filters.erb | 8 - templates/vhost/_header.epp | 8 + templates/vhost/_header.erb | 8 - templates/vhost/_http2.epp | 45 +++ templates/vhost/_http2.erb | 45 --- templates/vhost/_http_protocol_options.epp | 1 + templates/vhost/_http_protocol_options.erb | 1 - templates/vhost/_itk.epp | 29 ++ templates/vhost/_itk.erb | 29 -- templates/vhost/_jk_mounts.epp | 10 + templates/vhost/_jk_mounts.erb | 10 - templates/vhost/_keepalive_options.epp | 9 + templates/vhost/_keepalive_options.erb | 9 - templates/vhost/_logging.epp | 21 ++ templates/vhost/_logging.erb | 21 -- templates/vhost/_passenger.epp | 144 +++++++ templates/vhost/_passenger.erb | 144 ------- templates/vhost/_requestheader.epp | 8 + templates/vhost/_requestheader.erb | 8 - templates/vhost/_scriptalias.epp | 2 + templates/vhost/_security.epp | 61 +++ templates/vhost/_security.erb | 61 --- templates/vhost/_serveralias.epp | 7 + templates/vhost/_serveralias.erb | 7 - templates/vhost/_shib.epp | 4 + templates/vhost/_shib.erb | 4 - templates/vhost/_sslproxy.epp | 35 ++ templates/vhost/_sslproxy.erb | 35 -- templates/vhost/_suexec.epp | 4 + templates/vhost/_suexec.erb | 4 - templates/vhost/_use_canonical_name.erb | 4 - templates/vhost/_userdir.epp | 3 + templates/vhost/_userdir.erb | 3 - templates/vhost/_wsgi.epp | 50 +++ templates/vhost/_wsgi.erb | 50 --- 57 files changed, 827 insertions(+), 807 deletions(-) create mode 100644 templates/vhost/_action.epp delete mode 100644 templates/vhost/_action.erb create mode 100644 templates/vhost/_aliases.epp delete mode 100644 templates/vhost/_aliases.erb create mode 100644 templates/vhost/_allow_encoded_slashes.epp delete mode 100644 templates/vhost/_allow_encoded_slashes.erb create mode 100644 templates/vhost/_auth_cas.epp delete mode 100644 templates/vhost/_auth_cas.erb create mode 100644 templates/vhost/_charsets.epp delete mode 100644 templates/vhost/_charsets.erb create mode 100644 templates/vhost/_custom_fragment.epp delete mode 100644 templates/vhost/_custom_fragment.erb create mode 100644 templates/vhost/_docroot.epp delete mode 100644 templates/vhost/_docroot.erb create mode 100644 templates/vhost/_fallbackresource.epp delete mode 100644 templates/vhost/_fallbackresource.erb create mode 100644 templates/vhost/_file_footer.epp delete mode 100644 templates/vhost/_file_footer.erb create mode 100644 templates/vhost/_file_header.epp delete mode 100644 templates/vhost/_file_header.erb create mode 100644 templates/vhost/_filters.epp delete mode 100644 templates/vhost/_filters.erb create mode 100644 templates/vhost/_header.epp delete mode 100644 templates/vhost/_header.erb create mode 100644 templates/vhost/_http2.epp delete mode 100644 templates/vhost/_http2.erb create mode 100644 templates/vhost/_http_protocol_options.epp delete mode 100644 templates/vhost/_http_protocol_options.erb create mode 100644 templates/vhost/_itk.epp delete mode 100644 templates/vhost/_itk.erb create mode 100644 templates/vhost/_jk_mounts.epp delete mode 100644 templates/vhost/_jk_mounts.erb create mode 100644 templates/vhost/_keepalive_options.epp delete mode 100644 templates/vhost/_keepalive_options.erb create mode 100644 templates/vhost/_logging.epp delete mode 100644 templates/vhost/_logging.erb create mode 100644 templates/vhost/_passenger.epp delete mode 100644 templates/vhost/_passenger.erb create mode 100644 templates/vhost/_requestheader.epp delete mode 100644 templates/vhost/_requestheader.erb create mode 100644 templates/vhost/_scriptalias.epp create mode 100644 templates/vhost/_security.epp delete mode 100644 templates/vhost/_security.erb create mode 100644 templates/vhost/_serveralias.epp delete mode 100644 templates/vhost/_serveralias.erb create mode 100644 templates/vhost/_shib.epp delete mode 100644 templates/vhost/_shib.erb create mode 100644 templates/vhost/_sslproxy.epp delete mode 100644 templates/vhost/_sslproxy.erb create mode 100644 templates/vhost/_suexec.epp delete mode 100644 templates/vhost/_suexec.erb delete mode 100644 templates/vhost/_use_canonical_name.erb create mode 100644 templates/vhost/_userdir.epp delete mode 100644 templates/vhost/_userdir.erb create mode 100644 templates/vhost/_wsgi.epp delete mode 100644 templates/vhost/_wsgi.erb diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 969be0ea43..bb1ad02de8 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -2224,83 +2224,91 @@ } } - # Template uses: - # - $comment - # - $nvh_addr_port - # - $servername - # - $serveradmin - # - $protocols - # - $protocols_honor_order - # - $mdomain + $file_header_params = { + 'comment' => $comment, + 'nvh_addr_port' => $nvh_addr_port, + 'mdomain' => $mdomain, + 'servername' => $servername, + 'define' => $define, + 'protocols' => $protocols, + 'protocols_honor_order' => $protocols_honor_order, + 'limitreqfieldsize' => $limitreqfieldsize, + 'limitreqfields' => $limitreqfields, + 'limitreqline' => $limitreqline, + 'limitreqbody' => $limitreqbody, + 'serveradmin' => $serveradmin, + } + concat::fragment { "${name}-apache-header": target => "${priority_real}${filename}.conf", order => 0, - content => template('apache/vhost/_file_header.erb'), + content => epp('apache/vhost/_file_header.epp', $file_header_params), } - # Template uses: - # - $virtual_docroot - # - $virtual_use_default_docroot - # - $docroot if $docroot and $ensure == 'present' { if $virtual_docroot { include apache::mod::vhost_alias } + $docroot_params = { + 'virtual_docroot' => $virtual_docroot, + 'docroot' => $docroot, + 'virtual_use_default_docroot' => $virtual_use_default_docroot, + } + concat::fragment { "${name}-docroot": target => "${priority_real}${filename}.conf", order => 10, - content => template('apache/vhost/_docroot.erb'), + content => epp('apache/vhost/_docroot.epp', $docroot_params), } } - # Template uses: - # - $aliases if ! empty($aliases) and $ensure == 'present' { include apache::mod::alias - + $aliases_params = { + 'aliases' => $aliases, + } concat::fragment { "${name}-aliases": target => "${priority_real}${filename}.conf", order => 20, - content => template('apache/vhost/_aliases.erb'), + content => epp('apache/vhost/_aliases.epp', $aliases_params), } } - # Template uses: - # - $itk - # - $::kernelversion if $itk and ! empty($itk) { + $itk_params = { + 'itk' => $itk, + 'kernelversion' => $facts['kernelversion'], + } concat::fragment { "${name}-itk": target => "${priority_real}${filename}.conf", order => 30, - content => template('apache/vhost/_itk.erb'), + content => epp('apache/vhost/_itk.epp', $itk_params), } } - # Template uses: - # - $fallbackresource if $fallbackresource { + $fall_back_res_params = { + 'fallbackresource' => $fallbackresource, + } concat::fragment { "${name}-fallbackresource": target => "${priority_real}${filename}.conf", order => 40, - content => template('apache/vhost/_fallbackresource.erb'), + content => epp('apache/vhost/_fallbackresource.epp', $fall_back_res_params), } } - # Template uses: - # - $allow_encoded_slashes if $allow_encoded_slashes { + $allow_encoded_slashes_params = { + 'allow_encoded_slashes' => $allow_encoded_slashes, + } concat::fragment { "${name}-allow_encoded_slashes": target => "${priority_real}${filename}.conf", order => 50, - content => template('apache/vhost/_allow_encoded_slashes.erb'), + content => epp('apache/vhost/_allow_encoded_slashes.epp', $allow_encoded_slashes_params), } } - # Template uses: - # - $_directories - # - $docroot - # - $shibboleth_enabled if $_directories and ! empty($_directories) and $ensure == 'present' { $_directories.each |Hash $directory| { if 'auth_basic_authoritative' in $directory or 'auth_basic_fake' in $directory or 'auth_basic_provider' in $directory { @@ -2351,6 +2359,11 @@ } } + # Template uses: + # - $_directories + # - $docroot + # - $shibboleth_enabled + # - $cas_enabled concat::fragment { "${name}-directories": target => "${priority_real}${filename}.conf", order => 60, @@ -2360,6 +2373,7 @@ # Template uses: # - $additional_includes + # - $use_optional_includes if $additional_includes and ! empty($additional_includes) { concat::fragment { "${name}-additional_includes": target => "${priority_real}${filename}.conf", @@ -2368,20 +2382,21 @@ } } - # Template uses: - # - $error_log - # - $error_log_format - # - $log_level - # - $error_log_destination - # - $log_level if $error_log or $log_level { + $logging_params = { + 'error_log' => $error_log, + 'log_level' => $log_level, + 'error_log_destination' => $error_log_destination, + 'error_log_format' => $error_log_format, + } concat::fragment { "${name}-logging": target => "${priority_real}${filename}.conf", order => 80, - content => template('apache/vhost/_logging.erb'), + content => epp('apache/vhost/_logging.epp', $logging_params), } } + # Template uses no variables concat::fragment { "${name}-serversignature": target => "${priority_real}${filename}.conf", order => 90, @@ -2402,13 +2417,11 @@ } } - # Template uses: - # - $action if $action { concat::fragment { "${name}-action": target => "${priority_real}${filename}.conf", order => 110, - content => template('apache/vhost/_action.erb'), + content => epp('apache/vhost/_action.epp', { 'action' => $action }), } } @@ -2432,56 +2445,47 @@ } } - # Template uses: - # - $headers if ! empty($headers) and $ensure == 'present' { include apache::mod::headers concat::fragment { "${name}-header": target => "${priority_real}${filename}.conf", order => 140, - content => template('apache/vhost/_header.erb'), + content => epp('apache/vhost/_header.epp', { 'headers' => $headers }), } } - # Template uses: - # - $request_headers if ! empty($request_headers) and $ensure == 'present' { include apache::mod::headers concat::fragment { "${name}-requestheader": target => "${priority_real}${filename}.conf", order => 150, - content => template('apache/vhost/_requestheader.erb'), + content => epp('apache/vhost/_requestheader.epp', { 'request_headers' => $request_headers }), } } - # Template uses: - # - $ssl_proxyengine - # - $ssl_proxy_verify - # - $ssl_proxy_verify_depth - # - $ssl_proxy_ca_cert - # - $ssl_proxy_check_peer_cn - # - $ssl_proxy_check_peer_name - # - $ssl_proxy_check_peer_expire - # - $ssl_proxy_machine_cert - # - $ssl_proxy_machine_cert_chain - # - $ssl_proxy_protocol if $ssl_proxyengine { + $ssl_proxy_params = { + 'ssl_proxyengine' => $ssl_proxyengine, + 'ssl_proxy_verify' => $ssl_proxy_verify, + 'ssl_proxy_verify_depth' => $ssl_proxy_verify_depth, + 'ssl_proxy_ca_cert' => $ssl_proxy_ca_cert, + 'ssl_proxy_check_peer_cn' => $ssl_proxy_check_peer_cn, + 'ssl_proxy_check_peer_name' => $ssl_proxy_check_peer_name, + 'ssl_proxy_check_peer_expire' => $ssl_proxy_check_peer_expire, + 'ssl_proxy_machine_cert' => $ssl_proxy_machine_cert, + 'ssl_proxy_machine_cert_chain' => $ssl_proxy_machine_cert_chain, + 'ssl_proxy_cipher_suite' => $ssl_proxy_cipher_suite, + 'ssl_proxy_protocol' => $ssl_proxy_protocol, + } concat::fragment { "${name}-sslproxy": target => "${priority_real}${filename}.conf", order => 160, - content => template('apache/vhost/_sslproxy.erb'), + content => epp('apache/vhost/_sslproxy.epp', $ssl_proxy_params), } } - # Template uses: - # - $proxy_dest - # - $proxy_pass - # - $proxy_pass_match - # - $proxy_preserve_host - # - $proxy_add_headers - # - $no_proxy_uris if ($proxy_dest or $proxy_pass or $proxy_pass_match or $proxy_dest_match or $proxy_preserve_host or ($proxy_add_headers =~ NotUndef)) and $ensure == 'present' { include apache::mod::proxy_http @@ -2494,7 +2498,6 @@ include apache::mod::proxy_http2 } } - concat::fragment { "${name}-proxy": target => "${priority_real}${filename}.conf", order => 170, @@ -2534,7 +2537,6 @@ # - $rewrite_map if (! empty($rewrites) or $rewrite_rule or $rewrite_inherit) and $ensure == 'present' { include apache::mod::rewrite - concat::fragment { "${name}-rewrite": target => "${priority_real}${filename}.conf", order => 190, @@ -2542,31 +2544,27 @@ } } - # Template uses: - # - $scriptalias if $scriptalias and $ensure == 'present' { include apache::mod::alias - concat::fragment { "${name}-scriptalias": target => "${priority_real}${filename}.conf", order => 200, - content => template('apache/vhost/_scriptalias.erb'), + content => epp('apache/vhost/_scriptalias.epp', { 'scriptalias' => $scriptalias }), } } - # Template uses: - # - $serveraliases if ! empty($serveraliases) and $ensure == 'present' { concat::fragment { "${name}-serveralias": target => "${priority_real}${filename}.conf", order => 210, - content => template('apache/vhost/_serveralias.erb'), + content => epp('apache/vhost/_serveralias.epp', { 'serveraliases' => $serveraliases }), } } # Template uses: # - $setenv # - $setenvif + # - $setenvifnocase $use_env_mod = !empty($setenv) $use_setenvif_mod = !empty($setenvif) or !empty($setenvifnocase) if ($use_env_mod or $use_setenvif_mod) and $ensure == 'present' { @@ -2605,7 +2603,6 @@ # - $mdomain if $ssl and $ensure == 'present' { include apache::mod::ssl - concat::fragment { "${name}-ssl": target => "${priority_real}${filename}.conf", order => 230, @@ -2631,14 +2628,6 @@ } } - # Template uses: - # - $auth_kerb - # - $krb_method_negotiate - # - $krb_method_k5passwd - # - $krb_authoritative - # - $krb_auth_realms - # - $krb_5keytab - # - $krb_local_user_mapping if $auth_kerb and $ensure == 'present' { include apache::mod::auth_kerb @@ -2682,57 +2671,76 @@ } } - # Template uses: - # - $wsgi_application_group - # - $wsgi_daemon_process - # - $wsgi_daemon_process_options - # - $wsgi_import_script - # - $wsgi_import_script_options - # - $wsgi_process_group - # - $wsgi_script_aliases - # - $wsgi_pass_authorization if $wsgi_daemon_process_options { deprecation('apache::vhost::wsgi_daemon_process_options', 'This parameter is deprecated. Please add values inside Hash `wsgi_daemon_process`.') } 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) and $ensure == 'present' { include apache::mod::wsgi + $wsgi_params = { + 'wsgi_application_group' => $wsgi_application_group, + 'wsgi_daemon_process' => $wsgi_daemon_process, + 'wsgi_import_script' => $wsgi_import_script, + 'wsgi_process_group' => $wsgi_process_group, + 'wsgi_daemon_process_options'=> $wsgi_daemon_process_options, + 'wsgi_import_script_options' => $wsgi_import_script_options, + 'wsgi_script_aliases' => $wsgi_script_aliases, + 'wsgi_pass_authorization' => $wsgi_pass_authorization, + 'wsgi_chunked_request' => $wsgi_chunked_request, + 'wsgi_script_aliases_match' => $wsgi_script_aliases_match, + } concat::fragment { "${name}-wsgi": target => "${priority_real}${filename}.conf", order => 260, - content => template('apache/vhost/_wsgi.erb'), + content => epp('apache/vhost/_wsgi.epp', $wsgi_params), } } - # Template uses: - # - $custom_fragment if $custom_fragment { + $custom_fragment_params = { + 'custom_fragment' => $custom_fragment, + } concat::fragment { "${name}-custom_fragment": target => "${priority_real}${filename}.conf", order => 270, - content => template('apache/vhost/_custom_fragment.erb'), + content => epp('apache/vhost/_custom_fragment.epp', $custom_fragment_params), } } - # Template uses: - # - $suexec_user_group if $suexec_user_group and $ensure == 'present' { include apache::mod::suexec concat::fragment { "${name}-suexec": target => "${priority_real}${filename}.conf", order => 290, - content => template('apache/vhost/_suexec.erb'), + content => "SuexecUserGroup ${suexec_user_group}", } } if ('h2' in $protocols or 'h2c' in $protocols or $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) and $ensure == 'present' { include apache::mod::http2 + $http2_params = { + 'h2_copy_files' => $h2_copy_files, + 'h2_direct' => $h2_direct, + 'h2_early_hints' => $h2_early_hints, + 'h2_max_session_streams' => $h2_max_session_streams, + 'h2_modern_tls_only' => $h2_modern_tls_only, + 'h2_push' => $h2_push, + 'h2_push_diary_size' => $h2_push_diary_size, + 'h2_push_priority' => $h2_push_priority, + 'h2_push_resource' => $h2_push_resource, + 'h2_serialize_headers' => $h2_serialize_headers, + 'h2_stream_max_mem_size' => $h2_stream_max_mem_size, + 'h2_tls_cool_down_secs' => $h2_tls_cool_down_secs, + 'h2_tls_warm_up_size' => $h2_tls_warm_up_size, + 'h2_upgrade' => $h2_upgrade, + 'h2_window_size' => $h2_window_size, + } concat::fragment { "${name}-http2": target => "${priority_real}${filename}.conf", order => 300, - content => template('apache/vhost/_http2.erb'), + content => epp('apache/vhost/_http2.epp', $http2_params), } } @@ -2740,162 +2748,177 @@ include apache::mod::md } - # Template uses: - # - $userdir if $userdir and $ensure == 'present' { include apache::mod::userdir concat::fragment { "${name}-userdir": target => "${priority_real}${filename}.conf", order => 300, - content => template('apache/vhost/_userdir.erb'), + content => epp('apache/vhost/_userdir.epp', { 'userdir' => $userdir }), } } - # Template uses: - # - $passenger_enabled - # - $passenger_start_timeout - # - $passenger_ruby - # - $passenger_python - # - $passenger_nodejs - # - $passenger_meteor_app_settings - # - $passenger_app_env - # - $passenger_app_root - # - $passenger_app_group_name - # - $passenger_app_start_command - # - $passenger_app_type - # - $passenger_startup_file - # - $passenger_restart_dir - # - $passenger_spawn_method - # - $passenger_load_shell_envvars - # - $passenger_preload_bundler - # - $passenger_rolling_restarts - # - $passenger_resist_deployment_errors - # - $passenger_min_instances - # - $passenger_max_instances - # - $passenger_max_preloader_idle_time - # - $passenger_force_max_concurrent_requests_per_process - # - $passenger_concurrency_model - # - $passenger_thread_count - # - $passenger_high_performance - # - $passenger_max_request_queue_size - # - $passenger_max_request_queue_time - # - $passenger_user - # - $passenger_group - # - $passenger_friendly_error_pages - # - $passenger_buffer_upload - # - $passenger_buffer_response - # - $passenger_allow_encoded_slashes - # - $passenger_lve_min_uid - # - $passenger_base_uri - # - $passenger_error_override - # - $passenger_sticky_sessions - # - $passenger_sticky_sessions_cookie_name - # - $passenger_sticky_sessions_cookie_attributes - # - $passenger_app_log_file - # - $passenger_debugger - # - $passenger_max_requests - # - $passenger_max_request_time - # - $passenger_memory_limit - # - $passenger_dump_config_manifest - if ($passenger_enabled != undef or $passenger_start_timeout != undef or $passenger_ruby != undef or $passenger_python != undef or $passenger_nodejs != undef or $passenger_meteor_app_settings != undef or $passenger_app_env != undef or $passenger_app_root != undef or $passenger_app_group_name != undef or $passenger_app_start_command != undef or $passenger_app_type != undef or $passenger_startup_file != undef or $passenger_restart_dir != undef or $passenger_spawn_method != undef or $passenger_load_shell_envvars != undef or $passenger_preload_bundler != undef or $passenger_rolling_restarts != undef or $passenger_resist_deployment_errors != undef or $passenger_min_instances != undef or $passenger_max_instances != undef or $passenger_max_preloader_idle_time != undef or $passenger_force_max_concurrent_requests_per_process != undef or $passenger_concurrency_model != undef or $passenger_thread_count != undef or $passenger_high_performance != undef or $passenger_max_request_queue_size != undef or $passenger_max_request_queue_time != undef or $passenger_user != undef or $passenger_group != undef or $passenger_friendly_error_pages != undef or $passenger_buffer_upload != undef or $passenger_buffer_response != undef or $passenger_allow_encoded_slashes != undef or $passenger_lve_min_uid != undef or $passenger_base_uri != undef or $passenger_error_override != undef or $passenger_sticky_sessions != undef or $passenger_sticky_sessions_cookie_name != undef or $passenger_sticky_sessions_cookie_attributes != undef or $passenger_app_log_file != undef or $passenger_debugger != undef or $passenger_max_requests != undef or $passenger_max_request_time != undef or $passenger_memory_limit != undef or $passenger_dump_config_manifest != undef) and $ensure == 'present' { + if ($passenger_enabled != undef or $passenger_start_timeout != undef or $passenger_ruby != undef or $passenger_python != undef or $passenger_nodejs != undef or $passenger_meteor_app_settings != undef or $passenger_app_env != undef or $passenger_app_root != undef or $passenger_app_group_name != undef or $passenger_app_start_command != undef or $passenger_app_type != undef or$passenger_startup_file != undef or $passenger_restart_dir != undef or $passenger_spawn_method != undef or $passenger_load_shell_envvars != undef or $passenger_preload_bundler != undef or $passenger_rolling_restarts != undef or $passenger_resist_deployment_errors != undef or $passenger_min_instances != undef or $passenger_max_instances != undef or $passenger_max_preloader_idle_time != undef or $passenger_force_max_concurrent_requests_per_process != undef or $passenger_concurrency_model != undef or $passenger_thread_count != undef or $passenger_high_performance != undef or $passenger_max_request_queue_size != undef or $passenger_max_request_queue_time != undef or $passenger_user != undef or $passenger_group != undef or $passenger_friendly_error_pages != undef or $passenger_buffer_upload != undef or $passenger_buffer_response != undef or $passenger_allow_encoded_slashes != undef or $passenger_lve_min_uid != undef or $passenger_base_uri != undef or $passenger_error_override != undef or $passenger_sticky_sessions != undef or $passenger_sticky_sessions_cookie_name != undef or $passenger_sticky_sessions_cookie_attributes != undef or $passenger_app_log_file != undef or $passenger_debugger != undef or $passenger_max_requests != undef or $passenger_max_request_time != undef or $passenger_memory_limit != undef or $passenger_dump_config_manifest != undef) and $ensure == 'present' { include apache::mod::passenger + $passenger_params = { + 'passenger_enabled' => $passenger_enabled, + 'passenger_base_uri' => $passenger_base_uri, + 'passenger_ruby' => $passenger_ruby, + 'passenger_python' => $passenger_python, + 'passenger_nodejs' => $passenger_nodejs, + 'passenger_meteor_app_settings' => $passenger_meteor_app_settings, + 'passenger_app_env' => $passenger_app_env, + 'passenger_app_root' => $passenger_app_root, + 'passenger_app_group_name' => $passenger_app_group_name, + 'passenger_app_start_command' => $passenger_app_start_command, + 'passenger_app_type' => $passenger_app_type, + 'passenger_startup_file' => $passenger_startup_file, + 'passenger_restart_dir' => $passenger_restart_dir, + 'passenger_spawn_method' => $passenger_spawn_method, + 'passenger_load_shell_envvars' => $passenger_load_shell_envvars, + 'passenger_preload_bundler' => $passenger_preload_bundler, + 'passenger_rolling_restarts' => $passenger_rolling_restarts, + 'passenger_resist_deployment_errors' => $passenger_resist_deployment_errors, + 'passenger_user' => $passenger_user, + 'passenger_group' => $passenger_group, + 'passenger_friendly_error_pages' => $passenger_friendly_error_pages, + 'passenger_min_instances' => $passenger_min_instances, + 'passenger_max_instances' => $passenger_max_instances, + 'passenger_max_preloader_idle_time' => $passenger_max_preloader_idle_time, + 'passenger_force_max_concurrent_requests_per_process' => $passenger_force_max_concurrent_requests_per_process, + 'passenger_start_timeout' => $passenger_start_timeout, + 'passenger_concurrency_model' => $passenger_concurrency_model, + 'passenger_thread_count' => $passenger_thread_count, + 'passenger_max_requests' => $passenger_max_requests, + 'passenger_max_request_time' => $passenger_max_request_time, + 'passenger_memory_limit' => $passenger_memory_limit, + 'passenger_stat_throttle_rate' => $passenger_stat_throttle_rate, + 'passenger_high_performance' => $passenger_high_performance, + 'passenger_buffer_upload' => $passenger_buffer_upload, + 'passenger_buffer_response' => $passenger_buffer_response, + 'passenger_error_override' => $passenger_error_override, + 'passenger_max_request_queue_size' => $passenger_max_request_queue_size, + 'passenger_max_request_queue_time' => $passenger_max_request_queue_time, + 'passenger_sticky_sessions' => $passenger_sticky_sessions, + 'passenger_sticky_sessions_cookie_name' => $passenger_sticky_sessions_cookie_name, + 'passenger_sticky_sessions_cookie_attributes' => $passenger_sticky_sessions_cookie_attributes, + 'passenger_allow_encoded_slashes' => $passenger_allow_encoded_slashes, + 'passenger_app_log_file' => $passenger_app_log_file, + 'passenger_debugger' => $passenger_debugger, + 'passenger_lve_min_uid' => $passenger_lve_min_uid, + } concat::fragment { "${name}-passenger": target => "${priority_real}${filename}.conf", order => 300, - content => template('apache/vhost/_passenger.erb'), + content => epp('apache/vhost/_passenger.epp', $passenger_params), } } - # Template uses: - # - $add_default_charset if $add_default_charset { + $charsets_params = { + 'add_default_charset' => $add_default_charset, + } concat::fragment { "${name}-charsets": target => "${priority_real}${filename}.conf", order => 310, - content => template('apache/vhost/_charsets.erb'), + content => epp('apache/vhost/_charsets.epp', $charsets_params), } } - # Template uses: - # - $modsec_disable_vhost - # - $modsec_disable_ids - # - $modsec_disable_ips - # - $modsec_disable_msgs - # - $modsec_disable_tags - # - $modsec_body_limit - # - $modsec_audit_log_destination - # - $modsec_inbound_anomaly_threshold - # - $modsec_outbound_anomaly_threshold - # - $modsec_allowed_methods if $modsec_disable_vhost or $modsec_disable_ids or !empty($modsec_disable_ips) or $modsec_disable_msgs or $modsec_disable_tags or $modsec_audit_log_destination or ($modsec_inbound_anomaly_threshold and $modsec_outbound_anomaly_threshold) or $modsec_allowed_methods { + $security_params = { + 'modsec_disable_vhost' => $modsec_disable_vhost, + 'modsec_audit_log_destination' => $modsec_audit_log_destination, + '_modsec_disable_ids' => $modsec_disable_ids, + 'modsec_disable_ips' => $modsec_disable_ips, + '_modsec_disable_msgs' => $modsec_disable_msgs, + '_modsec_disable_tags' => $modsec_disable_tags, + 'modsec_body_limit' => $modsec_body_limit, + 'modsec_inbound_anomaly_threshold' => $modsec_inbound_anomaly_threshold, + 'modsec_outbound_anomaly_threshold' => $modsec_outbound_anomaly_threshold, + 'modsec_allowed_methods' => $modsec_allowed_methods, + } concat::fragment { "${name}-security": target => "${priority_real}${filename}.conf", order => 320, - content => template('apache/vhost/_security.erb'), + content => epp('apache/vhost/_security.epp', $security_params), } } - # Template uses: - # - $filters if ! empty($filters) and $ensure == 'present' { include apache::mod::filter concat::fragment { "${name}-filters": target => "${priority_real}${filename}.conf", order => 330, - content => template('apache/vhost/_filters.erb'), + content => epp('apache/vhost/_filters.epp', { 'filters' => $filters }), } } - # Template uses: - # - $jk_mounts if !empty($jk_mounts) and $ensure == 'present' { include apache::mod::jk concat::fragment { "${name}-jk_mounts": target => "${priority_real}${filename}.conf", order => 340, - content => template('apache/vhost/_jk_mounts.erb'), + content => epp('apache/vhost/_jk_mounts.epp', { 'jk_mounts' => $jk_mounts }), } } - # Template uses: - # - $keepalive - # - $keepalive_timeout - # - $max_keepalive_requests if $keepalive or $keepalive_timeout or $max_keepalive_requests { + $keep_alive_params = { + 'keepalive' => $keepalive, + 'keepalive_timeout' => $keepalive_timeout, + 'max_keepalive_requests' => $max_keepalive_requests, + } concat::fragment { "${name}-keepalive_options": target => "${priority_real}${filename}.conf", order => 350, - content => template('apache/vhost/_keepalive_options.erb'), + content => epp('apache/vhost/_keepalive_options.epp', $keep_alive_params), } } - # Template uses: - # - $cas_* if $cas_enabled { + $auth_cas_params = { + 'cas_enabled' => $cas_enabled, + 'cas_cookie_path' => $cas_cookie_path, + 'cas_login_url' => $cas_login_url, + 'cas_validate_url' => $cas_validate_url, + 'cas_version' => $apache::mod::auth_cas::cas_version, + 'cas_debug' => $apache::mod::auth_cas::cas_debug, + 'cas_certificate_path' => $apache::mod::auth_cas::cas_certificate_path, + 'cas_proxy_validate_url' => $apache::mod::auth_cas::cas_proxy_validate_url, + 'cas_validate_depth' => $apache::mod::auth_cas::cas_validate_depth, + 'cas_root_proxied_as' => $cas_root_proxied_as, + 'cas_cookie_entropy' => $apache::mod::auth_cas::cas_cookie_entropy, + 'cas_timeout' => $apache::mod::auth_cas::cas_timeout, + 'cas_idle_timeout' => $apache::mod::auth_cas::cas_idle_timeout, + 'cas_cache_clean_interval' => $apache::mod::auth_cas::cas_cache_clean_interval, + 'cas_cookie_domain' => $apache::mod::auth_cas::cas_cookie_domain, + 'cas_cookie_http_only' => $apache::mod::auth_cas::cas_cookie_http_only, + 'cas_authoritative' => $apache::mod::auth_cas::cas_authoritative, + 'cas_sso_enabled' => $cas_sso_enabled, + 'cas_validate_saml' => $cas_validate_saml, + 'cas_attribute_prefix' => $cas_attribute_prefix, + 'cas_attribute_delimiter' => $cas_attribute_delimiter, + 'cas_scrub_request_headers' => $cas_scrub_request_headers, + } concat::fragment { "${name}-auth_cas": target => "${priority_real}${filename}.conf", order => 350, - content => template('apache/vhost/_auth_cas.erb'), + content => epp('apache/vhost/_auth_cas.epp', $auth_cas_params), } } - # Template uses: - # - $http_protocol_options if $http_protocol_options { concat::fragment { "${name}-http_protocol_options": target => "${priority_real}${filename}.conf", order => 350, - content => template('apache/vhost/_http_protocol_options.erb'), + content => epp('apache/vhost/_http_protocol_options.epp', { 'http_protocol_options' => $http_protocol_options }), } } - # Template uses: - # - $auth_oidc - # - $oidc_settings if $auth_oidc and $ensure == 'present' { include apache::mod::auth_openidc @@ -2909,31 +2932,29 @@ } } - # Template uses: - # - $shib_compat_valid_user if $shibboleth_enabled { concat::fragment { "${name}-shibboleth": target => "${priority_real}${filename}.conf", order => 370, - content => template('apache/vhost/_shib.erb'), + content => epp('apache/vhost/_shib.epp', { 'shib_compat_valid_user' => $shib_compat_valid_user }), } } - # - $use_canonical_name if $use_canonical_name { concat::fragment { "${name}-use_canonical_name": target => "${priority_real}${filename}.conf", order => 360, - content => template('apache/vhost/_use_canonical_name.erb'), + content => "UseCanonicalName ${use_canonical_name}", } } - # Template uses: - # - $define - # - $passenger_pre_start + $file_footer_params = { + 'define' => $define, + 'passenger_pre_start' => $passenger_pre_start, + } concat::fragment { "${name}-file_footer": target => "${priority_real}${filename}.conf", order => 999, - content => template('apache/vhost/_file_footer.erb'), + content => epp('apache/vhost/_file_footer.epp', $file_footer_params), } } diff --git a/templates/vhost/_action.epp b/templates/vhost/_action.epp new file mode 100644 index 0000000000..1a08e18452 --- /dev/null +++ b/templates/vhost/_action.epp @@ -0,0 +1,4 @@ +<%- if $action { -%> + + Action <%= $action %> /cgi-bin virtual +<% } -%> diff --git a/templates/vhost/_action.erb b/templates/vhost/_action.erb deleted file mode 100644 index 8a02290595..0000000000 --- a/templates/vhost/_action.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% if @action -%> - - Action <%= @action %> /cgi-bin virtual -<% end -%> diff --git a/templates/vhost/_aliases.epp b/templates/vhost/_aliases.epp new file mode 100644 index 0000000000..f956f6a783 --- /dev/null +++ b/templates/vhost/_aliases.epp @@ -0,0 +1,14 @@ + ## Alias declarations for resources outside the DocumentRoot + <%- $aliases.each |$alias_statement| { -%> + <%- if $alias_statement["path"] { -%> + <%- if $alias_statement["alias"] { -%> + Alias <%= $alias_statement["alias"] %> "<%= $alias_statement["path"] %>" + <%- }elsif $alias_statement["aliasmatch"] { -%> + AliasMatch <%= $alias_statement["aliasmatch"] %> "<%= $alias_statement["path"] %>" + <%- } elsif $alias_statement["scriptalias"] { -%> + ScriptAlias <%= $alias_statement["scriptalias"] %> "<%= $alias_statement["path"] %>" + <%- } elsif $alias_statement["scriptaliasmatch"] { -%> + ScriptAliasMatch <%= $alias_statement["scriptaliasmatch"] %> "<%= $alias_statement["path"] %>" + <%- } -%> + <%- } -%> + <%- } -%> diff --git a/templates/vhost/_aliases.erb b/templates/vhost/_aliases.erb deleted file mode 100644 index 29b3e9961d..0000000000 --- a/templates/vhost/_aliases.erb +++ /dev/null @@ -1,14 +0,0 @@ - ## Alias declarations for resources outside the DocumentRoot - <%- @aliases.each do |alias_statement| -%> - <%- if alias_statement["path"] -%> - <%- if alias_statement["alias"] -%> - Alias <%= alias_statement["alias"] %> "<%= alias_statement["path"] %>" - <%- elsif alias_statement["aliasmatch"] -%> - AliasMatch <%= alias_statement["aliasmatch"] %> "<%= alias_statement["path"] %>" - <%- elsif alias_statement["scriptalias"] -%> - ScriptAlias <%= alias_statement["scriptalias"] %> "<%= alias_statement["path"] %>" - <%- elsif alias_statement["scriptaliasmatch"] -%> - ScriptAliasMatch <%= alias_statement["scriptaliasmatch"] %> "<%= alias_statement["path"] %>" - <%- end -%> - <%- end -%> - <%- end -%> diff --git a/templates/vhost/_allow_encoded_slashes.epp b/templates/vhost/_allow_encoded_slashes.epp new file mode 100644 index 0000000000..014a9e83fa --- /dev/null +++ b/templates/vhost/_allow_encoded_slashes.epp @@ -0,0 +1,4 @@ +<%- if $allow_encoded_slashes { -%> + + AllowEncodedSlashes <%= $allow_encoded_slashes %> +<%- } -%> diff --git a/templates/vhost/_allow_encoded_slashes.erb b/templates/vhost/_allow_encoded_slashes.erb deleted file mode 100644 index 40c73433b1..0000000000 --- a/templates/vhost/_allow_encoded_slashes.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%- if @allow_encoded_slashes -%> - - AllowEncodedSlashes <%= @allow_encoded_slashes %> -<%- end -%> diff --git a/templates/vhost/_auth_cas.epp b/templates/vhost/_auth_cas.epp new file mode 100644 index 0000000000..03b3cca982 --- /dev/null +++ b/templates/vhost/_auth_cas.epp @@ -0,0 +1,65 @@ +<%- if $cas_enabled { -%> + <%- if $cas_cookie_path { -%> + CASCookiePath <%= $cas_cookie_path %> + <%- } -%> + <%- if $cas_login_url { -%> + CASLoginURL <%= $cas_login_url %> + <%- } -%> + <%- if $cas_validate_url { -%> + CASValidateURL <%= $cas_validate_url %> + <%- } -%> + <%- if $cas_version { -%> + CASVersion <%= $cas_version %> + <%- } -%> + <%- if $cas_debug { -%> + CASDebug <%= $cas_debug %> + <%- } -%> + <%- if $cas_certificate_path { -%> + CASCertificatePath <%= $cas_certificate_path %> + <%- } -%> + <%- if $cas_proxy_validate_url { -%> + CASProxyValidateURL <%= $cas_proxy_validate_url %> + <%- } -%> + <%- if $cas_validate_depth { -%> + CASValidateDepth <%= $cas_validate_depth %> + <%- } -%> + <%- if $cas_root_proxied_as { -%> + CASRootProxiedAs <%= $cas_root_proxied_as %> + <%- } -%> + <%- if $cas_cookie_entropy { -%> + CASCookieEntropy <%= $cas_cookie_entropy %> + <%- } -%> + <%- if $cas_timeout { -%> + CASTimeout <%= $cas_timeout %> + <%- } -%> + <%- if $cas_idle_timeout { -%> + CASIdleTimeout <%= $cas_idle_timeout %> + <%- } -%> + <%- if $cas_cache_clean_interval { -%> + CASCacheCleanInterval <%= $cas_cache_clean_interval %> + <%- } -%> + <%- if $cas_cookie_domain { -%> + CASCookieDomain <%= $cas_cookie_domain %> + <%- } -%> + <%- if $cas_cookie_http_only { -%> + CASCookieHttpOnly <%= $cas_cookie_http_only %> + <%- } -%> + <%- if $cas_authoritative { -%> + CASAuthoritative <%= $cas_authoritative %> + <%- } -%> + <%- if $cas_sso_enabled { -%> + CASSSOEnabled On + <%- } -%> + <%- if $cas_validate_saml { -%> + CASValidateSAML On + <%- } -%> + <%- if $cas_attribute_prefix { -%> + CASAttributePrefix <%= $cas_attribute_prefix %> + <%- } -%> + <%- if $cas_attribute_delimiter { -%> + CASAttributeDelimiter <%= $cas_attribute_delimiter %> + <%- } -%> + <%- if $cas_scrub_request_headers { -%> + CASScrubRequestHeaders On + <%- } -%> +<%- } -%> diff --git a/templates/vhost/_auth_cas.erb b/templates/vhost/_auth_cas.erb deleted file mode 100644 index 39912a80ce..0000000000 --- a/templates/vhost/_auth_cas.erb +++ /dev/null @@ -1,65 +0,0 @@ -<% if @cas_enabled -%> - <%- if @cas_cookie_path -%> - CASCookiePath <%= @cas_cookie_path %> - <%- end -%> - <%- if @cas_login_url -%> - CASLoginURL <%= @cas_login_url %> - <%- end -%> - <%- if @cas_validate_url -%> - CASValidateURL <%= @cas_validate_url %> - <%- end -%> - <%- if @cas_version -%> - CASVersion <%= @cas_version %> - <%- end -%> - <%- if @cas_debug -%> - CASDebug <%= @cas_debug %> - <%- end -%> - <%- if @cas_certificate_path -%> - CASCertificatePath <%= @cas_certificate_path %> - <%- end -%> - <%- if @cas_proxy_validate_url -%> - CASProxyValidateURL <%= @cas_proxy_validate_url %> - <%- end -%> - <%- if @cas_validate_depth -%> - CASValidateDepth <%= @cas_validate_depth %> - <%- end -%> - <%- if @cas_root_proxied_as -%> - CASRootProxiedAs <%= @cas_root_proxied_as %> - <%- end -%> - <%- if @cas_cookie_entropy -%> - CASCookieEntropy <%= @cas_cookie_entropy %> - <%- end -%> - <%- if @cas_timeout -%> - CASTimeout <%= @cas_timeout %> - <%- end -%> - <%- if @cas_idle_timeout -%> - CASIdleTimeout <%= @cas_idle_timeout %> - <%- end -%> - <%- if @cas_cache_clean_interval -%> - CASCacheCleanInterval <%= @cas_cache_clean_interval %> - <%- end -%> - <%- if @cas_cookie_domain -%> - CASCookieDomain <%= @cas_cookie_domain %> - <%- end -%> - <%- if @cas_cookie_http_only -%> - CASCookieHttpOnly <%= @cas_cookie_http_only %> - <%- end -%> - <%- if @cas_authoritative -%> - CASAuthoritative <%= @cas_authoritative %> - <%- end -%> - <%- if @cas_sso_enabled -%> - CASSSOEnabled On - <%- end -%> - <%- if @cas_validate_saml -%> - CASValidateSAML On - <%- end -%> - <%- if @cas_attribute_prefix -%> - CASAttributePrefix <%= @cas_attribute_prefix %> - <%- end -%> - <%- if @cas_attribute_delimiter -%> - CASAttributeDelimiter <%= @cas_attribute_delimiter %> - <%- end -%> - <%- if @cas_scrub_request_headers -%> - CASScrubRequestHeaders On - <%- end -%> -<%- end -%> diff --git a/templates/vhost/_charsets.epp b/templates/vhost/_charsets.epp new file mode 100644 index 0000000000..1277941c41 --- /dev/null +++ b/templates/vhost/_charsets.epp @@ -0,0 +1,4 @@ +<%- if $add_default_charset { -%> + + AddDefaultCharset <%= $add_default_charset %> +<% } -%> diff --git a/templates/vhost/_charsets.erb b/templates/vhost/_charsets.erb deleted file mode 100644 index ef83def4b9..0000000000 --- a/templates/vhost/_charsets.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% if @add_default_charset -%> - - AddDefaultCharset <%= @add_default_charset %> -<% end -%> diff --git a/templates/vhost/_custom_fragment.epp b/templates/vhost/_custom_fragment.epp new file mode 100644 index 0000000000..d66f69ea2d --- /dev/null +++ b/templates/vhost/_custom_fragment.epp @@ -0,0 +1,5 @@ +<%- if $custom_fragment { -%> + + ## Custom fragment + <%= $custom_fragment %> +<% } -%> diff --git a/templates/vhost/_custom_fragment.erb b/templates/vhost/_custom_fragment.erb deleted file mode 100644 index 35c264adb9..0000000000 --- a/templates/vhost/_custom_fragment.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% if @custom_fragment -%> - - ## Custom fragment - <%= @custom_fragment %> -<% end -%> diff --git a/templates/vhost/_docroot.epp b/templates/vhost/_docroot.epp new file mode 100644 index 0000000000..5071838c13 --- /dev/null +++ b/templates/vhost/_docroot.epp @@ -0,0 +1,8 @@ + + ## Vhost docroot +<%- if $virtual_docroot { -%> + VirtualDocumentRoot "<%= $virtual_docroot %>" +<% } -%> +<%- if $docroot and ((! $virtual_docroot) or $virtual_use_default_docroot) { -%> + DocumentRoot "<%= $docroot %>" +<%- } -%> diff --git a/templates/vhost/_docroot.erb b/templates/vhost/_docroot.erb deleted file mode 100644 index 1ec495fe24..0000000000 --- a/templates/vhost/_docroot.erb +++ /dev/null @@ -1,8 +0,0 @@ - - ## Vhost docroot -<% if @virtual_docroot -%> - VirtualDocumentRoot "<%= @virtual_docroot %>" -<% end -%> -<% if @docroot and ((not @virtual_docroot) or @virtual_use_default_docroot) -%> - DocumentRoot "<%= @docroot %>" -<% end -%> diff --git a/templates/vhost/_fallbackresource.epp b/templates/vhost/_fallbackresource.epp new file mode 100644 index 0000000000..3d8082b9e1 --- /dev/null +++ b/templates/vhost/_fallbackresource.epp @@ -0,0 +1,4 @@ +<%- if $fallbackresource { -%> + + FallbackResource <%= $fallbackresource %> +<%- } -%> diff --git a/templates/vhost/_fallbackresource.erb b/templates/vhost/_fallbackresource.erb deleted file mode 100644 index f1e4c35dc4..0000000000 --- a/templates/vhost/_fallbackresource.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% if @fallbackresource -%> - - FallbackResource <%= @fallbackresource %> -<% end -%> diff --git a/templates/vhost/_file_footer.epp b/templates/vhost/_file_footer.epp new file mode 100644 index 0000000000..c8ef12c6af --- /dev/null +++ b/templates/vhost/_file_footer.epp @@ -0,0 +1,9 @@ +<%- $define.each | $k, $v| { -%> + Undefine <%= $k %> +<% } -%> + +<%- if $passenger_pre_start { -%> + <%- [$passenger_pre_start].flatten().filter |$value| { $value }.each |$passenger_pre_start| { -%> +PassengerPreStart <%= $passenger_pre_start %> + <%- } -%> +<%- } -%> diff --git a/templates/vhost/_file_footer.erb b/templates/vhost/_file_footer.erb deleted file mode 100644 index d42a1bdbe6..0000000000 --- a/templates/vhost/_file_footer.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% @define.each do | k, v| -%> - Undefine <%= k %> -<% end -%> - -<% if @passenger_pre_start -%> - <%- [@passenger_pre_start].flatten.compact.each do |passenger_pre_start| -%> -PassengerPreStart <%= passenger_pre_start %> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_file_header.epp b/templates/vhost/_file_header.epp new file mode 100644 index 0000000000..0fce926354 --- /dev/null +++ b/templates/vhost/_file_header.epp @@ -0,0 +1,43 @@ +# ************************************ +# Vhost template in module puppetlabs-apache +# Managed by Puppet +# ************************************ +<%= [$comment].flatten.map |$c| { "# ${c}" }.join("\n") -%> +<%- if $mdomain { -%> + + <%- if $mdomain =~ String { -%> + +MDomain <%= $mdomain %> + <%-} else {-%> +MDomain <%= $servername %> + <%- } -%> +<% } -%> + +> +<% $define.each | $k, $v| { -%> + Define <%= $k %> <%= $v %> +<% } -%> +<% if $servername and !$servername.empty { -%> + ServerName <%= $servername %> +<% } -%> +<% if $serveradmin { -%> + ServerAdmin <%= $serveradmin %> +<% } -%> +<%- unless $protocols.empty { -%> + Protocols <%= join($protocols, ' ') %> +<%- } -%> +<%- unless $protocols_honor_order == undef { -%> + ProtocolsHonorOrder <%= apache::bool2httpd($protocols_honor_order) %> +<%- } -%> +<% if $limitreqfieldsize { -%> + LimitRequestFieldSize <%= $limitreqfieldsize %> +<% } -%> +<% if $limitreqfields { -%> + LimitRequestFields <%= $limitreqfields %> +<% } -%> +<% if $limitreqline { -%> + LimitRequestLine <%= $limitreqline %> +<% } -%> +<% if $limitreqbody { -%> + LimitRequestBody <%= $limitreqbody %> +<% } %> diff --git a/templates/vhost/_file_header.erb b/templates/vhost/_file_header.erb deleted file mode 100644 index a9c7dcf9e2..0000000000 --- a/templates/vhost/_file_header.erb +++ /dev/null @@ -1,42 +0,0 @@ -# ************************************ -# Vhost template in module puppetlabs-apache -# Managed by Puppet -# ************************************ -<%= [@comment].flatten.collect{|c| "# #{c}"}.join("\n") -%> -<% if @mdomain -%> - - <%- if @mdomain.is_a?(String) -%> -MDomain <%= @mdomain %> - <%- else -%> -MDomain <%= @servername %> - <%- end -%> -<% end -%> - -> -<% @define.each do | k, v| -%> - Define <%= k %> <%= v %> -<% end -%> -<% if @servername and not @servername.empty? -%> - ServerName <%= @servername %> -<% end -%> -<% if @serveradmin -%> - ServerAdmin <%= @serveradmin %> -<% end -%> -<%- unless @protocols.empty? -%> - Protocols <%= @protocols.join(' ') %> -<%- end -%> -<%- unless @protocols_honor_order.nil? -%> - ProtocolsHonorOrder <%= scope.call_function('apache::bool2httpd', [@protocols_honor_order]) %> -<%- end -%> -<% if @limitreqfieldsize -%> - LimitRequestFieldSize <%= @limitreqfieldsize %> -<% end -%> -<% if @limitreqfields -%> - LimitRequestFields <%= @limitreqfields %> -<% end -%> -<% if @limitreqline -%> - LimitRequestLine <%= @limitreqline %> -<% end -%> -<% if @limitreqbody -%> - LimitRequestBody <%= @limitreqbody %> -<% end -%> diff --git a/templates/vhost/_filters.epp b/templates/vhost/_filters.epp new file mode 100644 index 0000000000..ff2d8ae000 --- /dev/null +++ b/templates/vhost/_filters.epp @@ -0,0 +1,8 @@ +<%- unless $filters.empty { -%> + + ## Filter module rules + ## as per http://httpd.apache.org/docs/2.4/mod/mod_filter.html + <%- $filters.each |$filter| { -%> + <%= $filter %> + <%- } -%> +<%- } -%> diff --git a/templates/vhost/_filters.erb b/templates/vhost/_filters.erb deleted file mode 100644 index bb36fc3914..0000000000 --- a/templates/vhost/_filters.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% unless @filters.empty? -%> - - ## Filter module rules - ## as per http://httpd.apache.org/docs/2.2/mod/mod_filter.html - <%- @filters.each do |filter| -%> - <%= filter %> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_header.epp b/templates/vhost/_header.epp new file mode 100644 index 0000000000..44066709c2 --- /dev/null +++ b/templates/vhost/_header.epp @@ -0,0 +1,8 @@ +<% unless $headers.empty { -%> + + ## Header rules + ## as per http://httpd.apache.org/docs/2.4/mod/mod_headers.html#header + <%- $headers.each |$header_statement| { -%> + Header <%= $header_statement %> + <%- } -%> +<% } -%> diff --git a/templates/vhost/_header.erb b/templates/vhost/_header.erb deleted file mode 100644 index 54f84cac5a..0000000000 --- a/templates/vhost/_header.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% unless @headers.empty? -%> - - ## Header rules - ## as per http://httpd.apache.org/docs/2.4/mod/mod_headers.html#header - <%- @headers.each do |header_statement| -%> - Header <%= header_statement %> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_http2.epp b/templates/vhost/_http2.epp new file mode 100644 index 0000000000..e62fcfd05b --- /dev/null +++ b/templates/vhost/_http2.epp @@ -0,0 +1,45 @@ +<% if $h2_copy_files != undef { -%> + H2CopyFiles <%= apache::bool2httpd($h2_copy_files) %> +<% } -%> +<% if $h2_direct != undef { -%> + H2Direct <%= apache::bool2httpd($h2_direct) %> +<% } -%> +<% if $h2_early_hints != undef {-%> + H2EarlyHints <%= apache::bool2httpd($h2_early_hints) %> +<% } -%> +<% if $h2_max_session_streams != undef { -%> + H2MaxSessionStreams <%= $h2_max_session_streams %> +<% } -%> +<%- if $h2_modern_tls_only != undef { -%> + H2ModernTLSOnly <%= apache::bool2httpd($h2_modern_tls_only) %> +<%- } -%> +<%- if $h2_push != undef { -%> + H2Push <%= apache::bool2httpd($h2_push) %> +<%- } -%> +<%- if $h2_push_diary_size != undef { -%> + H2PushDiarySize <%= $h2_push_diary_size %> +<%- } -%> +<%- $h2_push_priority.each |$expr| { -%> + H2PushPriority <%= $expr %> +<%- } -%> +<%- $h2_push_resource.each |$expr| { -%> + H2PushResource <%= $expr %> +<%- } -%> +<% if $h2_serialize_headers != undef { -%> + H2SerializeHeaders <%= apache::bool2httpd($h2_serialize_headers) %> +<% } -%> +<% if $h2_stream_max_mem_size != undef { -%> + H2StreamMaxMemSize <%= $h2_stream_max_mem_size %> +<% } -%> +<%- if $h2_tls_cool_down_secs != undef { -%> + H2TLSCoolDownSecs <%= $h2_tls_cool_down_secs %> +<%- } -%> +<%- if $h2_tls_warm_up_size != undef { -%> + H2TLSWarmUpSize <%= $h2_tls_warm_up_size %> +<%- } -%> +<% if $h2_upgrade != undef { -%> + H2Upgrade <%= apache::bool2httpd($h2_upgrade) %> +<% } -%> +<% if $h2_window_size != undef { -%> + H2WindowSize <%= $h2_window_size %> +<% } -%> diff --git a/templates/vhost/_http2.erb b/templates/vhost/_http2.erb deleted file mode 100644 index 063a89043f..0000000000 --- a/templates/vhost/_http2.erb +++ /dev/null @@ -1,45 +0,0 @@ -<% if !@h2_copy_files.nil? -%> - H2CopyFiles <%= scope.call_function('apache::bool2httpd', [@h2_copy_files]) %> -<% end -%> -<% unless @h2_direct.nil? -%> - H2Direct <%= scope.call_function('apache::bool2httpd', [@h2_direct]) %> -<% end -%> -<% if !@h2_early_hints.nil? -%> - H2EarlyHints <%= scope.call_function('apache::bool2httpd', [@h2_early_hints]) %> -<% end -%> -<% unless @h2_max_session_streams.nil? -%> - H2MaxSessionStreams <%= @h2_max_session_streams %> -<% end -%> -<%- unless @h2_modern_tls_only.nil? -%> - H2ModernTLSOnly <%= scope.call_function('apache::bool2httpd', [@h2_modern_tls_only]) %> -<%- end -%> -<%- unless @h2_push.nil? -%> - H2Push <%= scope.call_function('apache::bool2httpd', [@h2_push]) %> -<%- end -%> -<%- unless @h2_push_diary_size.nil? -%> - H2PushDiarySize <%= @h2_push_diary_size %> -<%- end -%> -<%- @h2_push_priority.each do |expr| -%> - H2PushPriority <%= expr %> -<%- end -%> -<%- @h2_push_resource.each do |expr| -%> - H2PushResource <%= expr %> -<%- end -%> -<% unless @h2_serialize_headers.nil? -%> - H2SerializeHeaders <%= scope.call_function('apache::bool2httpd', [@h2_serialize_headers]) %> -<% end -%> -<% unless @h2_stream_max_mem_size.nil? -%> - H2StreamMaxMemSize <%= @h2_stream_max_mem_size %> -<% end -%> -<%- unless @h2_tls_cool_down_secs.nil? -%> - H2TLSCoolDownSecs <%= @h2_tls_cool_down_secs %> -<%- end -%> -<%- unless @h2_tls_warm_up_size.nil? -%> - H2TLSWarmUpSize <%= @h2_tls_warm_up_size %> -<%- end -%> -<% unless @h2_upgrade.nil? -%> - H2Upgrade <%= scope.call_function('apache::bool2httpd', [@h2_upgrade]) %> -<% end -%> -<% unless @h2_window_size.nil? -%> - H2WindowSize <%= @h2_window_size %> -<% end -%> diff --git a/templates/vhost/_http_protocol_options.epp b/templates/vhost/_http_protocol_options.epp new file mode 100644 index 0000000000..7243ed02e5 --- /dev/null +++ b/templates/vhost/_http_protocol_options.epp @@ -0,0 +1 @@ +HttpProtocolOptions <%= $http_protocol_options %> diff --git a/templates/vhost/_http_protocol_options.erb b/templates/vhost/_http_protocol_options.erb deleted file mode 100644 index efad7e6d85..0000000000 --- a/templates/vhost/_http_protocol_options.erb +++ /dev/null @@ -1 +0,0 @@ -HttpProtocolOptions <%= @http_protocol_options %> diff --git a/templates/vhost/_itk.epp b/templates/vhost/_itk.epp new file mode 100644 index 0000000000..a628ae3170 --- /dev/null +++ b/templates/vhost/_itk.epp @@ -0,0 +1,29 @@ +<% if $itk and ! $itk.empty { -%> + + ## ITK statement + + <%- if $itk["user"] and $itk["group"] { -%> + AssignUserId <%= $itk["user"] %> <%= $itk["group"] %> + <%- } -%> + <%- if $itk["assignuseridexpr"] { -%> + AssignUserIdExpr <%= $itk["assignuseridexpr"] %> + <%- } -%> + <%- if $itk["assigngroupidexpr"] { -%> + AssignGroupIdExpr <%= $itk["assigngroupidexpr"] %> + <%- } -%> + <%- if $itk["maxclientvhost"] { -%> + MaxClientsVHost <%= $itk["maxclientvhost"] %> + <%- } -%> + <%- if $itk["nice"] { -%> + NiceValue <%= $itk["nice"] %> + <%- } -%> + <%- if $kernelversion >= '3.5.0' { -%> + <%- if $itk["limituidrange"] { -%> + LimitUIDRange <%= $itk["limituidrange"] %> + <%- } -%> + <%- if $itk["limitgidrange"] { -%> + LimitGIDRange <%= $itk["limitgidrange"] %> + <%- } -%> + <%- } -%> + +<% } -%> diff --git a/templates/vhost/_itk.erb b/templates/vhost/_itk.erb deleted file mode 100644 index 803a73db7f..0000000000 --- a/templates/vhost/_itk.erb +++ /dev/null @@ -1,29 +0,0 @@ -<% if @itk and ! @itk.empty? -%> - - ## ITK statement - - <%- if @itk["user"] and @itk["group"] -%> - AssignUserId <%= @itk["user"] %> <%= @itk["group"] %> - <%- end -%> - <%- if @itk["assignuseridexpr"] -%> - AssignUserIdExpr <%= @itk["assignuseridexpr"] %> - <%- end -%> - <%- if @itk["assigngroupidexpr"] -%> - AssignGroupIdExpr <%= @itk["assigngroupidexpr"] %> - <%- end -%> - <%- if @itk["maxclientvhost"] -%> - MaxClientsVHost <%= @itk["maxclientvhost"] %> - <%- end -%> - <%- if @itk["nice"] -%> - NiceValue <%= @itk["nice"] %> - <%- end -%> - <%- if @kernelversion >= '3.5.0' -%> - <%- if @itk["limituidrange"] -%> - LimitUIDRange <%= @itk["limituidrange"] %> - <%- end -%> - <%- if @itk["limitgidrange"] -%> - LimitGIDRange <%= @itk["limitgidrange"] %> - <%- end -%> - <%- end -%> - -<% end -%> diff --git a/templates/vhost/_jk_mounts.epp b/templates/vhost/_jk_mounts.epp new file mode 100644 index 0000000000..6577715d5d --- /dev/null +++ b/templates/vhost/_jk_mounts.epp @@ -0,0 +1,10 @@ +<% unless $jk_mounts.empty { -%> + + <%- $jk_mounts.each |$jk| { -%> + <%- if $jk['mount'] != undef and $jk['worker'] != undef { -%> + JkMount <%= $jk['mount'] %> <%= $jk['worker'] %> + <%-} elsif $jk['unmount'] != undef and $jk['worker'] != undef { -%> + JkUnMount <%= $jk['unmount'] %> <%= $jk['worker'] %> + <%- } -%> + <%- } -%> +<% } -%> diff --git a/templates/vhost/_jk_mounts.erb b/templates/vhost/_jk_mounts.erb deleted file mode 100644 index 3bd5a721a6..0000000000 --- a/templates/vhost/_jk_mounts.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% unless @jk_mounts.empty? -%> - - <%- @jk_mounts.each do |jk| -%> - <%- if jk.has_key?('mount') and jk.has_key?('worker') -%> - JkMount <%= jk['mount'] %> <%= jk['worker'] %> - <%- elsif jk.has_key?('unmount') and jk.has_key?('worker') -%> - JkUnMount <%= jk['unmount'] %> <%= jk['worker'] %> - <%- end -%> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_keepalive_options.epp b/templates/vhost/_keepalive_options.epp new file mode 100644 index 0000000000..192630811c --- /dev/null +++ b/templates/vhost/_keepalive_options.epp @@ -0,0 +1,9 @@ +<%- if $keepalive { -%> + KeepAlive <%= $keepalive %> +<%- } -%> +<%- if $keepalive_timeout { -%> + KeepAliveTimeout <%= $keepalive_timeout %> +<%- } -%> +<%- if $max_keepalive_requests { -%> + MaxKeepAliveRequests <%= $max_keepalive_requests %> +<%- } -%> diff --git a/templates/vhost/_keepalive_options.erb b/templates/vhost/_keepalive_options.erb deleted file mode 100644 index d14f5ed155..0000000000 --- a/templates/vhost/_keepalive_options.erb +++ /dev/null @@ -1,9 +0,0 @@ -<%- if @keepalive -%> - KeepAlive <%= @keepalive %> -<%- end -%> -<%- if @keepalive_timeout -%> - KeepAliveTimeout <%= @keepalive_timeout %> -<%- end -%> -<%- if @max_keepalive_requests -%> - MaxKeepAliveRequests <%= @max_keepalive_requests %> -<%- end -%> diff --git a/templates/vhost/_logging.epp b/templates/vhost/_logging.epp new file mode 100644 index 0000000000..183e6c2851 --- /dev/null +++ b/templates/vhost/_logging.epp @@ -0,0 +1,21 @@ +<% if $error_log or $log_level { -%> + + ## Logging +<% } -%> +<% if $error_log { -%> + ErrorLog "<%= $error_log_destination %>" +<% } -%> +<% if $log_level { -%> + LogLevel <%= $log_level %> +<% } -%> +<% if $error_log_format { -%> + <%- $error_log_format.each |$lfmt| { -%> + <%- if $lfmt =~ Hash { -%> + <%- $lfmt.each |$fmt, $flag| { -%> + ErrorLogFormat <%= $flag %> "<%= $fmt %>" + <%- } -%> + <%-} else { -%> + ErrorLogFormat "<%= $lfmt %>" + <%- } -%> + <%- } -%> +<% } -%> diff --git a/templates/vhost/_logging.erb b/templates/vhost/_logging.erb deleted file mode 100644 index 91c328046b..0000000000 --- a/templates/vhost/_logging.erb +++ /dev/null @@ -1,21 +0,0 @@ -<% if @error_log or @log_level -%> - - ## Logging -<% end -%> -<% if @error_log -%> - ErrorLog "<%= @error_log_destination %>" -<% end -%> -<% if @log_level -%> - LogLevel <%= @log_level %> -<% end -%> -<% if @error_log_format -%> - <%- @error_log_format.each do |lfmt| -%> - <%- if lfmt.is_a?(Hash) -%> - <%- lfmt.each do |fmt, flag| -%> - ErrorLogFormat <%= flag %> "<%= fmt %>" - <%- end -%> - <%- else -%> - ErrorLogFormat "<%= lfmt %>" - <%- end -%> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_passenger.epp b/templates/vhost/_passenger.epp new file mode 100644 index 0000000000..05400a7592 --- /dev/null +++ b/templates/vhost/_passenger.epp @@ -0,0 +1,144 @@ +<%# 1 - Essentials -%> +<%# 2 - Deployment options -%> +<% unless $passenger_enabled == undef { -%> + PassengerEnabled <%= apache::bool2httpd($passenger_enabled) %> +<% } -%> +<% if $passenger_base_uri { -%> + PassengerBaseURI <%= $passenger_base_uri %> +<% } -%> +<%# 3 - Application loading options -%> +<% if $passenger_ruby { -%> + PassengerRuby <%= $passenger_ruby %> +<% } -%> +<% if $passenger_python { -%> + PassengerPython <%= $passenger_python %> +<% } -%> +<% if $passenger_nodejs { -%> + PassengerNodejs <%= $passenger_nodejs %> +<% } -%> +<% if $passenger_meteor_app_settings { -%> + PassengerMeteorAppSettings <%= $passenger_meteor_app_settings %> +<% } -%> +<% if $passenger_app_env { -%> + PassengerAppEnv <%= $passenger_app_env %> +<% } -%> +<% if $passenger_app_root { -%> + PassengerAppRoot <%= $passenger_app_root %> +<% } -%> +<% if $passenger_app_group_name { -%> + PassengerAppGroupName <%= $passenger_app_group_name %> +<% } -%> +<% if $passenger_app_start_command { -%> + PassengerAppStartCommand <%= $passenger_app_start_command %> +<% } -%> +<% if $passenger_app_type { -%> + PassengerAppType <%= $passenger_app_type %> +<% } -%> +<% if $passenger_startup_file { -%> + PassengerStartupFile <%= $passenger_startup_file %> +<% } -%> +<% if $passenger_restart_dir { -%> + PassengerRestartDir <%= $passenger_restart_dir %> +<% } -%> +<% if $passenger_spawn_method { -%> + PassengerSpawnMethod <%= $passenger_spawn_method %> +<% } -%> +<% unless $passenger_load_shell_envvars == undef { -%> + PassengerLoadShellEnvvars <%= apache::bool2httpd($passenger_load_shell_envvars) %> +<% } -%> +<% unless $passenger_preload_bundler == undef { -%> + PassengerPreloadBundler <%= apache::bool2httpd($passenger_preload_bundler) %> +<% } -%> +<% unless $passenger_rolling_restarts == undef { -%> + PassengerRollingRestarts <%= apache::bool2httpd($passenger_rolling_restarts) %> +<% } -%> +<% unless $passenger_resist_deployment_errors == undef { -%> + PassengerResistDeploymentErrors <%= apache::bool2httpd($passenger_resist_deployment_errors) %> +<% } -%> +<%# 4 - Security options -%> +<% if $passenger_user {-%> + PassengerUser <%= $passenger_user %> +<% } -%> +<% if $passenger_group {-%> + PassengerGroup <%= $passenger_group %> +<% } -%> +<% unless $passenger_friendly_error_pages == undef { -%> + PassengerFriendlyErrorPages <%= apache::bool2httpd($passenger_friendly_error_pages) %> +<% } -%> +<%# 5 - Resource control and optimization options -%> +<% if $passenger_min_instances { -%> + PassengerMinInstances <%= $passenger_min_instances %> +<% } -%> +<% if $passenger_max_instances { -%> + PassengerMaxInstances <%= $passenger_max_instances %> +<% } -%> +<% if $passenger_max_preloader_idle_time { -%> + PassengerMaxPreloaderIdleTime <%= $passenger_max_preloader_idle_time %> +<% } -%> +<% if $passenger_force_max_concurrent_requests_per_process { -%> + PassengerForceMaxConcurrentRequestsPerProcess <%= $passenger_force_max_concurrent_requests_per_process %> +<% } -%> +<% if $passenger_start_timeout { -%> + PassengerStartTimeout <%= $passenger_start_timeout %> +<% } -%> +<% if $passenger_concurrency_model { -%> + PassengerConcurrencyModel <%= $passenger_concurrency_model %> +<% } -%> +<% if $passenger_thread_count { -%> + PassengerThreadCount <%= $passenger_thread_count %> +<% } -%> +<% if $passenger_max_requests { -%> + PassengerMaxRequests <%= $passenger_max_requests %> +<% } -%> +<% if $passenger_max_request_time { -%> + PassengerMaxRequestTime <%= $passenger_max_request_time %> +<% } -%> +<% if $passenger_memory_limit { -%> + PassengerMemoryLimit <%= $passenger_memory_limit %> +<% } -%> +<% if $passenger_stat_throttle_rate { -%> + PassengerStatThrottleRate <%= $passenger_stat_throttle_rate %> +<% } -%> +<% unless $passenger_high_performance == undef { -%> + PassengerHighPerformance <%= apache::bool2httpd($passenger_high_performance) %> +<% } -%> +<%# 6 - Connection handling options -%> +<% unless $passenger_buffer_upload == undef { -%> + PassengerBufferUpload <%= apache::bool2httpd($passenger_buffer_upload) %> +<% } -%> +<% unless $passenger_buffer_response == undef { -%> + PassengerBufferResponse <%= apache::bool2httpd($passenger_buffer_response) %> +<% } -%> +<% unless $passenger_error_override == undef { -%> + PassengerErrorOverride <%= apache::bool2httpd($passenger_error_override) %> +<% } -%> +<% if $passenger_max_request_queue_size { -%> + PassengerMaxRequestQueueSize <%= $passenger_max_request_queue_size %> +<% } -%> +<% if $passenger_max_request_queue_time { -%> + PassengerMaxRequestQueueTime <%= $passenger_max_request_queue_time %> +<% } -%> +<% unless $passenger_sticky_sessions == undef { -%> + PassengerStickySessions <%= apache::bool2httpd($passenger_sticky_sessions) %> +<% } -%> +<% if $passenger_sticky_sessions_cookie_name { -%> + PassengerStickySessionsCookieName <%= $passenger_sticky_sessions_cookie_name %> +<% } -%> +<% if $passenger_sticky_sessions_cookie_attributes { -%> + PassengerStickySessionsCookieAttributes <%= $passenger_sticky_sessions_cookie_attributes %> +<% } -%> +<%# 7 - Compatibility options -%> +<% unless $passenger_allow_encoded_slashes == undef { -%> + PassengerAllowEncodedSlashes <%= apache::bool2httpd($passenger_allow_encoded_slashes) %> +<% } -%> +<% if $passenger_app_log_file { -%> + PassengerAppLogFile <%= $passenger_app_log_file %> +<% } -%> +<%# 8 - Logging and debugging options -%> +<% unless $passenger_debugger == undef { -%> + PassengerDebugger <%= apache::bool2httpd($passenger_debugger) %> +<% } -%> +<%# 9 - Advanced options -%> +<% if $passenger_lve_min_uid { -%> + PassengerLveMinUid <%= $passenger_lve_min_uid %> +<% } -%> diff --git a/templates/vhost/_passenger.erb b/templates/vhost/_passenger.erb deleted file mode 100644 index b14f9245b6..0000000000 --- a/templates/vhost/_passenger.erb +++ /dev/null @@ -1,144 +0,0 @@ -<%# 1 - Essentials -%> -<%# 2 - Deployment options -%> -<% unless @passenger_enabled.nil? -%> - PassengerEnabled <%= scope.call_function('apache::bool2httpd', [@passenger_enabled]) %> -<% end -%> -<% if @passenger_base_uri -%> - PassengerBaseURI <%= @passenger_base_uri %> -<% end -%> -<%# 3 - Application loading options -%> -<% if @passenger_ruby -%> - PassengerRuby <%= @passenger_ruby %> -<% end -%> -<% if @passenger_python -%> - PassengerPython <%= @passenger_python %> -<% end -%> -<% if @passenger_nodejs -%> - PassengerNodejs <%= @passenger_nodejs %> -<% end -%> -<% if @passenger_meteor_app_settings -%> - PassengerMeteorAppSettings <%= @passenger_meteor_app_settings %> -<% end -%> -<% if @passenger_app_env -%> - PassengerAppEnv <%= @passenger_app_env %> -<% end -%> -<% if @passenger_app_root -%> - PassengerAppRoot <%= @passenger_app_root %> -<% end -%> -<% if @passenger_app_group_name -%> - PassengerAppGroupName <%= @passenger_app_group_name %> -<% end -%> -<% if @passenger_app_start_command -%> - PassengerAppStartCommand <%= @passenger_app_start_command %> -<% end -%> -<% if @passenger_app_type -%> - PassengerAppType <%= @passenger_app_type %> -<% end -%> -<% if @passenger_startup_file -%> - PassengerStartupFile <%= @passenger_startup_file %> -<% end -%> -<% if @passenger_restart_dir -%> - PassengerRestartDir <%= @passenger_restart_dir %> -<% end -%> -<% if @passenger_spawn_method -%> - PassengerSpawnMethod <%= @passenger_spawn_method %> -<% end -%> -<% unless @passenger_load_shell_envvars.nil? -%> - PassengerLoadShellEnvvars <%= scope.call_function('apache::bool2httpd', [@passenger_load_shell_envvars]) %> -<% end -%> -<% unless @passenger_preload_bundler.nil? -%> - PassengerPreloadBundler <%= scope.call_function('apache::bool2httpd', [@passenger_preload_bundler]) %> -<% end -%> -<% unless @passenger_rolling_restarts.nil? -%> - PassengerRollingRestarts <%= scope.call_function('apache::bool2httpd', [@passenger_rolling_restarts]) %> -<% end -%> -<% unless @passenger_resist_deployment_errors.nil? -%> - PassengerResistDeploymentErrors <%= scope.call_function('apache::bool2httpd', [@passenger_resist_deployment_errors]) %> -<% end -%> -<%# 4 - Security options -%> -<% if @passenger_user -%> - PassengerUser <%= @passenger_user %> -<% end -%> -<% if @passenger_group -%> - PassengerGroup <%= @passenger_group %> -<% end -%> -<% unless @passenger_friendly_error_pages.nil? -%> - PassengerFriendlyErrorPages <%= scope.call_function('apache::bool2httpd', [@passenger_friendly_error_pages]) %> -<% end -%> -<%# 5 - Resource control and optimization options -%> -<% if @passenger_min_instances -%> - PassengerMinInstances <%= @passenger_min_instances %> -<% end -%> -<% if @passenger_max_instances -%> - PassengerMaxInstances <%= @passenger_max_instances %> -<% end -%> -<% if @passenger_max_preloader_idle_time -%> - PassengerMaxPreloaderIdleTime <%= @passenger_max_preloader_idle_time %> -<% end -%> -<% if @passenger_force_max_concurrent_requests_per_process -%> - PassengerForceMaxConcurrentRequestsPerProcess <%= @passenger_force_max_concurrent_requests_per_process %> -<% end -%> -<% if @passenger_start_timeout -%> - PassengerStartTimeout <%= @passenger_start_timeout %> -<% end -%> -<% if @passenger_concurrency_model -%> - PassengerConcurrencyModel <%= @passenger_concurrency_model %> -<% end -%> -<% if @passenger_thread_count -%> - PassengerThreadCount <%= @passenger_thread_count %> -<% end -%> -<% if @passenger_max_requests -%> - PassengerMaxRequests <%= @passenger_max_requests %> -<% end -%> -<% if @passenger_max_request_time -%> - PassengerMaxRequestTime <%= @passenger_max_request_time %> -<% end -%> -<% if @passenger_memory_limit -%> - PassengerMemoryLimit <%= @passenger_memory_limit %> -<% end -%> -<% if @passenger_stat_throttle_rate -%> - PassengerStatThrottleRate <%= @passenger_stat_throttle_rate %> -<% end -%> -<% unless @passenger_high_performance.nil? -%> - PassengerHighPerformance <%= scope.call_function('apache::bool2httpd', [@passenger_high_performance]) %> -<% end -%> -<%# 6 - Connection handling options -%> -<% unless @passenger_buffer_upload.nil? -%> - PassengerBufferUpload <%= scope.call_function('apache::bool2httpd', [@passenger_buffer_upload]) %> -<% end -%> -<% unless @passenger_buffer_response.nil? -%> - PassengerBufferResponse <%= scope.call_function('apache::bool2httpd', [@passenger_buffer_response]) %> -<% end -%> -<% unless @passenger_error_override.nil? -%> - PassengerErrorOverride <%= scope.call_function('apache::bool2httpd', [@passenger_error_override]) %> -<% end -%> -<% if @passenger_max_request_queue_size -%> - PassengerMaxRequestQueueSize <%= @passenger_max_request_queue_size %> -<% end -%> -<% if @passenger_max_request_queue_time -%> - PassengerMaxRequestQueueTime <%= @passenger_max_request_queue_time %> -<% end -%> -<% unless @passenger_sticky_sessions.nil? -%> - PassengerStickySessions <%= scope.call_function('apache::bool2httpd', [@passenger_sticky_sessions]) %> -<% end -%> -<% if @passenger_sticky_sessions_cookie_name -%> - PassengerStickySessionsCookieName <%= @passenger_sticky_sessions_cookie_name %> -<% end -%> -<% if @passenger_sticky_sessions_cookie_attributes -%> - PassengerStickySessionsCookieAttributes <%= @passenger_sticky_sessions_cookie_attributes %> -<% end -%> -<%# 7 - Compatibility options -%> -<% unless @passenger_allow_encoded_slashes.nil? -%> - PassengerAllowEncodedSlashes <%= scope.call_function('apache::bool2httpd', [@passenger_allow_encoded_slashes]) %> -<% end -%> -<% if @passenger_app_log_file -%> - PassengerAppLogFile <%= @passenger_app_log_file %> -<% end -%> -<%# 8 - Logging and debugging options -%> -<% unless @passenger_debugger.nil? -%> - PassengerDebugger <%= scope.call_function('apache::bool2httpd', [@passenger_debugger]) %> -<% end -%> -<%# 9 - Advanced options -%> -<% if @passenger_lve_min_uid -%> - PassengerLveMinUid <%= @passenger_lve_min_uid %> -<% end -%> diff --git a/templates/vhost/_requestheader.epp b/templates/vhost/_requestheader.epp new file mode 100644 index 0000000000..4cd20075ac --- /dev/null +++ b/templates/vhost/_requestheader.epp @@ -0,0 +1,8 @@ +<% unless $request_headers.empty { -%> + + ## Request header rules + ## as per http://httpd.apache.org/docs/2.4/mod/mod_headers.html#requestheader + <%- $request_headers.each |$request_statement| { -%> + RequestHeader <%= $request_statement %> + <%- } -%> +<% } -%> diff --git a/templates/vhost/_requestheader.erb b/templates/vhost/_requestheader.erb deleted file mode 100644 index 56ee68b299..0000000000 --- a/templates/vhost/_requestheader.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% unless @request_headers.empty? -%> - - ## Request header rules - ## as per http://httpd.apache.org/docs/2.4/mod/mod_headers.html#requestheader - <%- @request_headers.each do |request_statement| -%> - RequestHeader <%= request_statement %> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_scriptalias.epp b/templates/vhost/_scriptalias.epp new file mode 100644 index 0000000000..0fd99592bd --- /dev/null +++ b/templates/vhost/_scriptalias.epp @@ -0,0 +1,2 @@ + ## Script alias directives + ScriptAlias /cgi-bin "<%= $scriptalias %>" diff --git a/templates/vhost/_security.epp b/templates/vhost/_security.epp new file mode 100644 index 0000000000..24d3b4a39c --- /dev/null +++ b/templates/vhost/_security.epp @@ -0,0 +1,61 @@ + +<% if $modsec_disable_vhost {-%> + SecRuleEngine Off +<% } -%> +<% if $modsec_audit_log_destination {-%> + SecAuditLog "<%= $modsec_audit_log_destination %>" +<% } -%> +<% if $_modsec_disable_ids =~ Hash {-%> +<% $_modsec_disable_ids.each |$location, $rules| {-%> + > +<% Array($rules).each |$rule| {-%> + SecRuleRemoveById <%= $rule %> +<% } -%> + +<% } -%> +<% } -%> +<% unless $modsec_disable_ips.empty {%> + SecRule REMOTE_ADDR "<%= join($modsec_disable_ips, ',') %>" "nolog,allow,id:1234123455" + SecAction "phase:2,pass,nolog,id:1234123456" +<% } -%> +<% if $_modsec_disable_msgs =~ Hash {-%> +<% $_modsec_disable_msgs.each |$location, $rules| {-%> + > +<% Array($rules).each |$rule| {-%> + SecRuleRemoveByMsg "<%= $rule %>" +<% } -%> + +<% } -%> +<% } -%> +<% if $_modsec_disable_tags =~ Hash {-%> +<% $_modsec_disable_tags.each |$location, $rules| {-%> + > +<% Array($rules).each |$rule| {-%> + SecRuleRemoveByTag "<%= $rule %>" +<% } -%> + +<% } -%> +<% } -%> +<% if $modsec_body_limit {-%> + SecRequestBodyLimit <%= $modsec_body_limit %> +<% } -%> +<% if $modsec_inbound_anomaly_threshold and $modsec_outbound_anomaly_threshold {-%> + SecAction \ + "id:900110,\ + phase:1,\ + nolog,\ + pass,\ + t:none,\ + setvar:tx.inbound_anomaly_score_threshold=<%= $modsec_inbound_anomaly_threshold -%>, \ + setvar:tx.outbound_anomaly_score_threshold=<%= $modsec_outbound_anomaly_threshold -%>" +<% } -%> +<% if $modsec_allowed_methods {-%> + SecAction \ + "id:900200,\ + phase:1,\ + nolog,\ + pass,\ + t:none,\ + setvar:'tx.allowed_methods=<%= $modsec_allowed_methods -%>'" +<% } -%> + diff --git a/templates/vhost/_security.erb b/templates/vhost/_security.erb deleted file mode 100644 index 0d804d683c..0000000000 --- a/templates/vhost/_security.erb +++ /dev/null @@ -1,61 +0,0 @@ - -<% if @modsec_disable_vhost -%> - SecRuleEngine Off -<% end -%> -<% if @modsec_audit_log_destination -%> - SecAuditLog "<%= @modsec_audit_log_destination %>" -<% end -%> -<% if @_modsec_disable_ids.is_a?(Hash) -%> -<% @_modsec_disable_ids.each do |location,rules| -%> - > -<% Array(rules).each do |rule| -%> - SecRuleRemoveById <%= rule %> -<% end -%> - -<% end -%> -<% end -%> -<% unless @modsec_disable_ips.empty? %> - SecRule REMOTE_ADDR "<%= @modsec_disable_ips.join(',') %>" "nolog,allow,id:1234123455" - SecAction "phase:2,pass,nolog,id:1234123456" -<% end -%> -<% if @_modsec_disable_msgs.is_a?(Hash) -%> -<% @_modsec_disable_msgs.each do |location,rules| -%> - > -<% Array(rules).each do |rule| -%> - SecRuleRemoveByMsg "<%= rule %>" -<% end -%> - -<% end -%> -<% end -%> -<% if @_modsec_disable_tags.is_a?(Hash) -%> -<% @_modsec_disable_tags.each do |location,rules| -%> - > -<% Array(rules).each do |rule| -%> - SecRuleRemoveByTag "<%= rule %>" -<% end -%> - -<% end -%> -<% end -%> -<% if @modsec_body_limit -%> - SecRequestBodyLimit <%= @modsec_body_limit %> -<% end -%> -<% if @modsec_inbound_anomaly_threshold and @modsec_outbound_anomaly_threshold -%> - SecAction \ - "id:900110,\ - phase:1,\ - nolog,\ - pass,\ - t:none,\ - setvar:tx.inbound_anomaly_score_threshold=<%= @modsec_inbound_anomaly_threshold -%>, \ - setvar:tx.outbound_anomaly_score_threshold=<%= @modsec_outbound_anomaly_threshold -%>" -<% end -%> -<% if @modsec_allowed_methods -%> - SecAction \ - "id:900200,\ - phase:1,\ - nolog,\ - pass,\ - t:none,\ - setvar:'tx.allowed_methods=<%= @modsec_allowed_methods -%>'" -<% end -%> - diff --git a/templates/vhost/_serveralias.epp b/templates/vhost/_serveralias.epp new file mode 100644 index 0000000000..5b9abb2817 --- /dev/null +++ b/templates/vhost/_serveralias.epp @@ -0,0 +1,7 @@ +<% unless $serveraliases.empty { -%> + + ## Server aliases + <%- Array($serveraliases).each |$serveralias| { -%> + ServerAlias <%= $serveralias %> + <%- } -%> +<% } -%> diff --git a/templates/vhost/_serveralias.erb b/templates/vhost/_serveralias.erb deleted file mode 100644 index ef8bec8554..0000000000 --- a/templates/vhost/_serveralias.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% unless @serveraliases.empty? -%> - - ## Server aliases - <%- Array(@serveraliases).each do |serveralias| -%> - ServerAlias <%= serveralias %> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_shib.epp b/templates/vhost/_shib.epp new file mode 100644 index 0000000000..a5b5505808 --- /dev/null +++ b/templates/vhost/_shib.epp @@ -0,0 +1,4 @@ + ## Shibboleth +<% if $shib_compat_valid_user { -%> + ShibCompatValidUser <%= $shib_compat_valid_user %> +<% } -%> diff --git a/templates/vhost/_shib.erb b/templates/vhost/_shib.erb deleted file mode 100644 index 610e4a439b..0000000000 --- a/templates/vhost/_shib.erb +++ /dev/null @@ -1,4 +0,0 @@ - ## Shibboleth -<% if @shib_compat_valid_user -%> - ShibCompatValidUser <%= @shib_compat_valid_user %> -<% end -%> diff --git a/templates/vhost/_sslproxy.epp b/templates/vhost/_sslproxy.epp new file mode 100644 index 0000000000..683d68dd33 --- /dev/null +++ b/templates/vhost/_sslproxy.epp @@ -0,0 +1,35 @@ +<% if $ssl_proxyengine { -%> + + # SSL Proxy directives + SSLProxyEngine On + <%- if $ssl_proxy_verify { -%> + SSLProxyVerify <%= $ssl_proxy_verify %> + <%- } -%> + <%- if $ssl_proxy_verify_depth { -%> + SSLProxyVerifyDepth <%= $ssl_proxy_verify_depth %> + <%- } -%> + <%- if $ssl_proxy_ca_cert { -%> + SSLProxyCACertificateFile "<%= $ssl_proxy_ca_cert %>" + <%- } -%> + <%- if $ssl_proxy_check_peer_cn { -%> + SSLProxyCheckPeerCN <%= $ssl_proxy_check_peer_cn %> + <%- } -%> + <%- if $ssl_proxy_check_peer_name { -%> + SSLProxyCheckPeerName <%= $ssl_proxy_check_peer_name %> + <%- } -%> + <%- if $ssl_proxy_check_peer_expire { -%> + SSLProxyCheckPeerExpire <%= $ssl_proxy_check_peer_expire %> + <%- } -%> + <%- if $ssl_proxy_machine_cert { -%> + SSLProxyMachineCertificateFile "<%= $ssl_proxy_machine_cert %>" + <%- } -%> + <%- if $ssl_proxy_machine_cert_chain { -%> + SSLProxyMachineCertificateChainFile "<%= $ssl_proxy_machine_cert_chain %>" + <%- } -%> + <%- if $ssl_proxy_cipher_suite { -%> + SSLProxyCipherSuite <%= $ssl_proxy_cipher_suite %> + <%- } -%> + <%- if $ssl_proxy_protocol { -%> + SSLProxyProtocol <%= join([$ssl_proxy_protocol].flatten().filter |$v| { $v },' ') %> + <%- } -%> +<% } -%> diff --git a/templates/vhost/_sslproxy.erb b/templates/vhost/_sslproxy.erb deleted file mode 100644 index ff6b61e3c9..0000000000 --- a/templates/vhost/_sslproxy.erb +++ /dev/null @@ -1,35 +0,0 @@ -<% if @ssl_proxyengine -%> - - # SSL Proxy directives - SSLProxyEngine On - <%- if @ssl_proxy_verify -%> - SSLProxyVerify <%= @ssl_proxy_verify %> - <%- end -%> - <%- if @ssl_proxy_verify_depth -%> - SSLProxyVerifyDepth <%= @ssl_proxy_verify_depth %> - <%- end -%> - <%- if @ssl_proxy_ca_cert -%> - SSLProxyCACertificateFile "<%= @ssl_proxy_ca_cert %>" - <%- end -%> - <%- if @ssl_proxy_check_peer_cn -%> - SSLProxyCheckPeerCN <%= @ssl_proxy_check_peer_cn %> - <%- end -%> - <%- if @ssl_proxy_check_peer_name -%> - SSLProxyCheckPeerName <%= @ssl_proxy_check_peer_name %> - <%- end -%> - <%- if @ssl_proxy_check_peer_expire -%> - SSLProxyCheckPeerExpire <%= @ssl_proxy_check_peer_expire %> - <%- end -%> - <%- if @ssl_proxy_machine_cert -%> - SSLProxyMachineCertificateFile "<%= @ssl_proxy_machine_cert %>" - <%- end -%> - <%- if @ssl_proxy_machine_cert_chain -%> - SSLProxyMachineCertificateChainFile "<%= @ssl_proxy_machine_cert_chain %>" - <%- end -%> - <%- if @ssl_proxy_cipher_suite -%> - SSLProxyCipherSuite <%= @ssl_proxy_cipher_suite %> - <%- end -%> - <%- if @ssl_proxy_protocol -%> - SSLProxyProtocol <%= [@ssl_proxy_protocol].flatten.compact.join(' ') %> - <%- end -%> -<% end -%> diff --git a/templates/vhost/_suexec.epp b/templates/vhost/_suexec.epp new file mode 100644 index 0000000000..da0f3eb59d --- /dev/null +++ b/templates/vhost/_suexec.epp @@ -0,0 +1,4 @@ +<% if $suexec_user_group { -%> + +SuexecUserGroup <%= $suexec_user_group %> +<% } -%> diff --git a/templates/vhost/_suexec.erb b/templates/vhost/_suexec.erb deleted file mode 100644 index 8a7ae0f17f..0000000000 --- a/templates/vhost/_suexec.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% if @suexec_user_group -%> - - SuexecUserGroup <%= @suexec_user_group %> -<% end -%> diff --git a/templates/vhost/_use_canonical_name.erb b/templates/vhost/_use_canonical_name.erb deleted file mode 100644 index 4f2e3ee224..0000000000 --- a/templates/vhost/_use_canonical_name.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%- if @use_canonical_name -%> - - UseCanonicalName <%= @use_canonical_name %> -<%- end -%> diff --git a/templates/vhost/_userdir.epp b/templates/vhost/_userdir.epp new file mode 100644 index 0000000000..a97b722da6 --- /dev/null +++ b/templates/vhost/_userdir.epp @@ -0,0 +1,3 @@ + <%- [$userdir].flatten.each |$userdir| { -%> + UserDir <%= $userdir %> + <%- } -%> diff --git a/templates/vhost/_userdir.erb b/templates/vhost/_userdir.erb deleted file mode 100644 index 0c6523ba0c..0000000000 --- a/templates/vhost/_userdir.erb +++ /dev/null @@ -1,3 +0,0 @@ - <%- [@userdir].flatten.each do |userdir| -%> - UserDir <%= userdir %> - <%- end -%> diff --git a/templates/vhost/_wsgi.epp b/templates/vhost/_wsgi.epp new file mode 100644 index 0000000000..b26ec759eb --- /dev/null +++ b/templates/vhost/_wsgi.epp @@ -0,0 +1,50 @@ +<% if $wsgi_application_group or $wsgi_daemon_process or $wsgi_import_script or $wsgi_process_group { -%> + + ## WSGI configuration +<% } -%> +<% if $wsgi_application_group { -%> + WSGIApplicationGroup <%= $wsgi_application_group %> +<% } -%> +<% if $wsgi_daemon_process =~ String and $wsgi_daemon_process_options { -%> + WSGIDaemonProcess <%= $wsgi_daemon_process %> <%= join(sort($wsgi_daemon_process_options.map |$k,$v| { "$k=$v" }), ' ') %> +<%} elsif $wsgi_daemon_process =~ String and !$wsgi_daemon_process_options { -%> + WSGIDaemonProcess <%= $wsgi_daemon_process %> +<%} elsif $wsgi_daemon_process =~ Hash { -%> + <%- $wsgi_daemon_process.each |$key, $val| { -%> + <%- if $val.empty { -%> + WSGIDaemonProcess <%= $key %> + <%-} else { -%> + WSGIDaemonProcess <%= $key %> <%= join(sort($val.map |$k,$v| { "$k=$v"}), ' ') %> +<% } -%> +<% } -%> +<% } -%> +<% if $wsgi_import_script and $wsgi_import_script_options { -%> + WSGIImportScript <%= $wsgi_import_script %> <%= join(sort($wsgi_import_script_options.map |$k,$v| { "$k=$v" }), ' ') %> +<% } -%> +<% if $wsgi_process_group { -%> + WSGIProcessGroup <%= $wsgi_process_group %> +<% } -%> +<% if $wsgi_script_aliases_match and ! $wsgi_script_aliases_match.empty { -%> + <%- $wsgi_script_aliases_match.each |$key, $value| { -%> + <%- if $key != '' and $value != ''{ -%> + WSGIScriptAliasMatch <%= $key %> "<%= $value %>" + <%- } -%> + <%- } -%> +<% } -%> +<% if $wsgi_script_aliases and ! $wsgi_script_aliases.empty { -%> + <%- $wsgi_script_aliases.each |$key, $value| { -%> + <%- if $key != '' and $value != ''{ -%> + <%- if $value =~ Array { -%> + WSGIScriptAlias <%= $key %> <%= join($value, ' ') %> + <%-} else { -%> + WSGIScriptAlias <%= $key %> "<%= $value %>" + <%- } -%> + <%- } -%> + <%- } -%> +<% } -%> +<% if $wsgi_pass_authorization { -%> + WSGIPassAuthorization <%= $wsgi_pass_authorization %> +<% } -%> +<% if $wsgi_chunked_request { -%> + WSGIChunkedRequest <%= $wsgi_chunked_request %> +<% } -%> diff --git a/templates/vhost/_wsgi.erb b/templates/vhost/_wsgi.erb deleted file mode 100644 index 775ae0fe48..0000000000 --- a/templates/vhost/_wsgi.erb +++ /dev/null @@ -1,50 +0,0 @@ -<% if @wsgi_application_group or @wsgi_daemon_process or @wsgi_import_script or @wsgi_process_group -%> - - ## WSGI configuration -<% end -%> -<% if @wsgi_application_group -%> - WSGIApplicationGroup <%= @wsgi_application_group %> -<% end -%> -<% if @wsgi_daemon_process.is_a? String and @wsgi_daemon_process_options -%> - WSGIDaemonProcess <%= @wsgi_daemon_process %> <%= @wsgi_daemon_process_options.collect { |k,v| "#{k}=#{v}"}.sort.join(' ') %> -<% elsif @wsgi_daemon_process.is_a? String and !@wsgi_daemon_process_options -%> - WSGIDaemonProcess <%= @wsgi_daemon_process %> -<% elsif @wsgi_daemon_process.is_a? Hash -%> - <%- @wsgi_daemon_process.each do |key, val| -%> - <%- if val.empty? -%> - WSGIDaemonProcess <%= key %> - <%- else -%> - WSGIDaemonProcess <%= key %> <%= val.collect { |k,v| "#{k}=#{v}"}.sort.join(' ') %> -<% end -%> -<% end -%> -<% end -%> -<% if @wsgi_import_script and @wsgi_import_script_options -%> - WSGIImportScript <%= @wsgi_import_script %> <%= @wsgi_import_script_options.collect { |k,v| "#{k}=#{v}"}.sort.join(' ') %> -<% end -%> -<% if @wsgi_process_group -%> - WSGIProcessGroup <%= @wsgi_process_group %> -<% end -%> -<% if @wsgi_script_aliases_match and ! @wsgi_script_aliases_match.empty? -%> - <%- @wsgi_script_aliases_match.sort.reverse.each do |key, value| -%> - <%- if key != '' and value != ''-%> - WSGIScriptAliasMatch <%= key %> "<%= value %>" - <%- end -%> - <%- end -%> -<% end -%> -<% if @wsgi_script_aliases and ! @wsgi_script_aliases.empty? -%> - <%- @wsgi_script_aliases.sort.reverse.each do |key, value| -%> - <%- if key != '' and value != ''-%> - <%- if value.is_a? Array -%> - WSGIScriptAlias <%= key %> <%= value.join(' ') %> - <%- else -%> - WSGIScriptAlias <%= key %> "<%= value %>" - <%- end -%> - <%- end -%> - <%- end -%> -<% end -%> -<% if @wsgi_pass_authorization -%> - WSGIPassAuthorization <%= @wsgi_pass_authorization %> -<% end -%> -<% if @wsgi_chunked_request -%> - WSGIChunkedRequest <%= @wsgi_chunked_request %> -<% end -%>