1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
# Security
ServerTokens <%= $server_tokens %>
ServerSignature <%= apache::bool2httpd($server_signature) %>
TraceEnable <%= apache::bool2httpd($trace_enable) %>
ServerName "<%= $servername %>"
ServerRoot "<%= $server_root %>"
<%- if $serveradmin { -%>
ServerAdmin <%= $serveradmin %>
<%- } -%>
PidFile <%= $pidfile %>
Timeout <%= $timeout %>
KeepAlive <%= $keepalive %>
MaxKeepAliveRequests <%= $max_keepalive_requests %>
KeepAliveTimeout <%= $keepalive_timeout %>
LimitRequestFieldSize <%= $limitreqfieldsize %>
LimitRequestFields <%= $limitreqfields %>
<% if $limitreqline { -%>
LimitRequestLine <%= $limitreqline %>
<% } -%>
<%- if $http_protocol_options { -%>
HttpProtocolOptions <%= $http_protocol_options %>
<%- } -%>
<%- unless $protocols.empty { -%>
Protocols <%= $protocols.join(' ') %>
<%- } -%>
<%- if $protocols_honor_order { -%>
ProtocolsHonorOrder <%= apache::bool2httpd($protocols_honor_order) %>
<%- } -%>
User <%= $user %>
Group <%= $group %>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
<Directory />
Options <%= Array($root_directory_options).join(' ') %>
AllowOverride None
<%- if $root_directory_secured { -%>
Require all denied
<%- } -%>
</Directory>
<% if $default_charset { -%>
AddDefaultCharset <%= $default_charset %>
<% } -%>
HostnameLookups <%= $hostname_lookups %>
<%- if $error_log.match(/^[|\/]/) or $error_log.match(/^syslog:/) { -%>
ErrorLog "<%= $error_log %>"
<%- }else { -%>
ErrorLog "<%= $logroot %>/<%= $error_log %>"
<% } -%>
LogLevel <%= $log_level %>
EnableSendfile <%= $sendfile %>
<%- if $allow_encoded_slashes { -%>
AllowEncodedSlashes <%= $allow_encoded_slashes %>
<%- } -%>
<%- if $file_e_tag { -%>
FileETag <%= $file_e_tag %>
<%- } -%>
<%- if $use_canonical_name { -%>
UseCanonicalName <%= $use_canonical_name %>
<%- } -%>
#Listen 80
<% if $apxs_workaround { -%>
# Workaround: without this hack apxs would be confused about where to put
# LoadModule directives and fail entire procedure of apache package
# installation/reinstallation. This problem was observed on FreeBSD (apache22).
#LoadModule fake_module libexec/apache22/mod_fake.so
<% } -%>
Include "<%= $mod_load_dir %>/*.load"
<% if $mod_load_dir != $confd_dir and $mod_load_dir != $vhost_load_dir { -%>
Include "<%= $mod_load_dir %>/*.conf"
<% } -%>
Include "<%= $ports_file %>"
<% unless $log_formats['combined'] { -%>
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
<% } -%>
<% unless $log_formats['common'] { -%>
LogFormat "%a %l %u %t \"%r\" %>s %b" common
<% } -%>
<% unless $log_formats['referer'] { -%>
LogFormat "%{Referer}i -> %U" referer
<% } -%>
<% unless $log_formats['agent'] { -%>
LogFormat "%{User-agent}i" agent
<% } -%>
<% unless $log_formats['forwarded'] { -%>
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\"" forwarded
<% } -%>
<% if $log_formats and !$log_formats.empty { -%>
<%- $log_formats.convert_to(Array).sort.each |$values| { -%>
LogFormat "<%= $values[1] -%>" <%= $values[0] %>
<%- } -%>
<% } -%>
<%- if $conf_enabled { -%>
IncludeOptional "<%= $conf_enabled %>/*.conf"
<%- } -%>
IncludeOptional "<%= $confd_dir %>/*.conf"
<% if $vhost_load_dir != $confd_dir { -%>
IncludeOptional "<%= $vhost_load_dir %>/<%= $vhost_include_pattern %>"
<% } -%>
<% if $ldap_verify_server_cert { -%>
LDAPVerifyServerCert <%= $ldap_verify_server_cert %>
<% } -%>
<% if $ldap_trusted_mode { -%>
LDAPTrustedMode <%= $ldap_trusted_mode %>
<% } -%>
<% if $error_documents { -%>
# /usr/share/apache2/error on debian
Alias /error/ "<%=$error_documents_path %>/"
<Directory "<%= $error_documents_path %>">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Require all granted
LanguagePriority en cs de es fr it nl sv pt-br ro
ForceLanguagePriority Prefer Fallback
</Directory>
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
<% } -%>
|