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