28
|
1 |
# Security
|
|
2 |
ServerTokens <%= @server_tokens %>
|
|
3 |
ServerSignature <%= scope.function_bool2httpd([@server_signature]) %>
|
|
4 |
TraceEnable <%= scope.function_bool2httpd([@trace_enable]) %>
|
|
5 |
|
|
6 |
ServerName "<%= @servername %>"
|
|
7 |
ServerRoot "<%= @server_root %>"
|
|
8 |
PidFile <%= @pidfile %>
|
|
9 |
Timeout <%= @timeout %>
|
|
10 |
KeepAlive <%= @keepalive %>
|
|
11 |
MaxKeepAliveRequests <%= @max_keepalive_requests %>
|
|
12 |
KeepAliveTimeout <%= @keepalive_timeout %>
|
|
13 |
|
|
14 |
<%- if @rewrite_lock and scope.function_versioncmp([@apache_version, '2.2']) <= 0 -%>
|
|
15 |
RewriteLock <%= @rewrite_lock %>
|
|
16 |
<%- end -%>
|
|
17 |
|
|
18 |
User <%= @user %>
|
|
19 |
Group <%= @group %>
|
|
20 |
|
|
21 |
AccessFileName .htaccess
|
|
22 |
<FilesMatch "^\.ht">
|
|
23 |
<%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
|
|
24 |
Require all denied
|
|
25 |
<%- else -%>
|
|
26 |
Order allow,deny
|
|
27 |
Deny from all
|
|
28 |
Satisfy all
|
|
29 |
<%- end -%>
|
|
30 |
</FilesMatch>
|
|
31 |
|
|
32 |
<Directory />
|
|
33 |
Options FollowSymLinks
|
|
34 |
AllowOverride None
|
|
35 |
</Directory>
|
|
36 |
|
|
37 |
<% if @default_charset -%>
|
|
38 |
AddDefaultCharset <%= @default_charset %>
|
|
39 |
<% end -%>
|
|
40 |
|
|
41 |
<%- if scope.function_versioncmp([@apache_version, '2.4']) < 0 -%>
|
|
42 |
DefaultType <%= @default_type %>
|
|
43 |
<%- end -%>
|
|
44 |
HostnameLookups Off
|
|
45 |
ErrorLog "<%= @logroot %>/<%= @error_log %>"
|
|
46 |
LogLevel <%= @log_level %>
|
|
47 |
EnableSendfile <%= @sendfile %>
|
|
48 |
<%- if @allow_encoded_slashes -%>
|
|
49 |
AllowEncodedSlashes <%= @allow_encoded_slashes %>
|
|
50 |
<%- end -%>
|
|
51 |
|
|
52 |
#Listen 80
|
|
53 |
|
|
54 |
<% if @apxs_workaround -%>
|
|
55 |
# Workaround: without this hack apxs would be confused about where to put
|
|
56 |
# LoadModule directives and fail entire procedure of apache package
|
|
57 |
# installation/reinstallation. This problem was observed on FreeBSD (apache22).
|
|
58 |
#LoadModule fake_module libexec/apache22/mod_fake.so
|
|
59 |
<% end -%>
|
|
60 |
|
|
61 |
Include "<%= @mod_load_dir %>/*.load"
|
|
62 |
<% if @mod_load_dir != @confd_dir and @mod_load_dir != @vhost_load_dir -%>
|
|
63 |
Include "<%= @mod_load_dir %>/*.conf"
|
|
64 |
<% end -%>
|
|
65 |
Include "<%= @ports_file %>"
|
|
66 |
|
|
67 |
<% unless @log_formats.has_key?('combined') -%>
|
|
68 |
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
|
69 |
<% end -%>
|
|
70 |
<% unless @log_formats.has_key?('common') -%>
|
|
71 |
LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
|
72 |
<% end -%>
|
|
73 |
<% unless @log_formats.has_key?('referer') -%>
|
|
74 |
LogFormat "%{Referer}i -> %U" referer
|
|
75 |
<% end -%>
|
|
76 |
<% unless @log_formats.has_key?('agent') -%>
|
|
77 |
LogFormat "%{User-agent}i" agent
|
|
78 |
<% end -%>
|
|
79 |
<% if @log_formats and !@log_formats.empty? -%>
|
|
80 |
<%- @log_formats.sort.each do |nickname,format| -%>
|
|
81 |
LogFormat "<%= format -%>" <%= nickname %>
|
|
82 |
<%- end -%>
|
|
83 |
<% end -%>
|
|
84 |
|
|
85 |
<%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
|
|
86 |
IncludeOptional "<%= @confd_dir %>/*.conf"
|
|
87 |
<%- else -%>
|
|
88 |
Include "<%= @confd_dir %>/*.conf"
|
|
89 |
<%- end -%>
|
|
90 |
<% if @vhost_load_dir != @confd_dir -%>
|
|
91 |
<%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
|
|
92 |
IncludeOptional "<%= @vhost_load_dir %>/<%= @vhost_include_pattern %>"
|
|
93 |
<%- else -%>
|
|
94 |
Include "<%= @vhost_load_dir %>/<%= @vhost_include_pattern %>"
|
|
95 |
<%- end -%>
|
|
96 |
<% end -%>
|
|
97 |
|
|
98 |
<% if @error_documents -%>
|
|
99 |
# /usr/share/apache2/error on debian
|
|
100 |
Alias /error/ "<%= @error_documents_path %>/"
|
|
101 |
|
|
102 |
<Directory "<%= @error_documents_path %>">
|
|
103 |
AllowOverride None
|
|
104 |
Options IncludesNoExec
|
|
105 |
AddOutputFilter Includes html
|
|
106 |
AddHandler type-map var
|
|
107 |
<%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
|
|
108 |
Require all granted
|
|
109 |
<%- else -%>
|
|
110 |
Order allow,deny
|
|
111 |
Allow from all
|
|
112 |
<%- end -%>
|
|
113 |
LanguagePriority en cs de es fr it nl sv pt-br ro
|
|
114 |
ForceLanguagePriority Prefer Fallback
|
|
115 |
</Directory>
|
|
116 |
|
|
117 |
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
|
|
118 |
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
|
|
119 |
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
|
|
120 |
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
|
|
121 |
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
|
|
122 |
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
|
|
123 |
ErrorDocument 410 /error/HTTP_GONE.html.var
|
|
124 |
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
|
|
125 |
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
|
|
126 |
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
|
|
127 |
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
|
|
128 |
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
|
|
129 |
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
|
|
130 |
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
|
|
131 |
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
|
|
132 |
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
|
|
133 |
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
|
|
134 |
<% end -%>
|