1 |
misc |
80 |
class apache { |
2 |
|
|
|
3 |
|
|
class base { |
4 |
|
|
package { "apache-mpm-prefork": |
5 |
misc |
117 |
alias => apache, |
6 |
misc |
80 |
ensure => installed |
7 |
|
|
} |
8 |
|
|
|
9 |
misc |
1065 |
package { "apache-conf": |
10 |
|
|
ensure => installed, |
11 |
|
|
} |
12 |
|
|
|
13 |
misc |
96 |
service { httpd: |
14 |
|
|
alias => apache, |
15 |
misc |
80 |
ensure => running, |
16 |
|
|
subscribe => [ Package['apache-mpm-prefork'] ], |
17 |
|
|
} |
18 |
misc |
117 |
|
19 |
|
|
file { "customization.conf": |
20 |
|
|
ensure => present, |
21 |
misc |
126 |
path => "/etc/httpd/conf.d/customization.conf", |
22 |
misc |
117 |
content => template("apache/customization.conf"), |
23 |
misc |
1065 |
require => Package["apache-conf"], |
24 |
misc |
117 |
notify => Service["apache"], |
25 |
|
|
owner => root, |
26 |
|
|
group => root, |
27 |
|
|
mode => 644, |
28 |
|
|
} |
29 |
boklm |
207 |
|
30 |
|
|
file { "00_default_vhosts.conf": |
31 |
|
|
path => "/etc/httpd/conf/vhosts.d/00_default_vhosts.conf", |
32 |
|
|
ensure => "present", |
33 |
|
|
owner => root, |
34 |
|
|
group => root, |
35 |
|
|
mode => 644, |
36 |
|
|
notify => Service['apache'], |
37 |
misc |
1065 |
require => Package["apache-conf"], |
38 |
boklm |
207 |
content => template("apache/00_default_vhosts.conf") |
39 |
|
|
} |
40 |
boklm |
1241 |
|
41 |
misc |
80 |
} |
42 |
|
|
|
43 |
|
|
class mod_php inherits base { |
44 |
boklm |
1494 |
include php::base |
45 |
misc |
80 |
package { "apache-mod_php": |
46 |
|
|
ensure => installed |
47 |
|
|
} |
48 |
misc |
1185 |
|
49 |
|
|
file { "/etc/httpd/conf.d/mod_php.conf": |
50 |
|
|
ensure => present, |
51 |
|
|
owner => root, |
52 |
|
|
group => root, |
53 |
|
|
mode => 644, |
54 |
|
|
require => Package['apache-conf'], |
55 |
misc |
1188 |
content => template('apache/mod_php.conf'), |
56 |
misc |
1186 |
notify => Service['apache'], |
57 |
misc |
1185 |
} |
58 |
misc |
80 |
} |
59 |
|
|
|
60 |
|
|
class mod_perl inherits base { |
61 |
|
|
package { "apache-mod_perl": |
62 |
|
|
ensure => installed |
63 |
|
|
} |
64 |
|
|
} |
65 |
|
|
|
66 |
misc |
84 |
class mod_fcgid inherits base { |
67 |
|
|
package { "apache-mod_fcgid": |
68 |
|
|
ensure => installed |
69 |
|
|
} |
70 |
|
|
} |
71 |
|
|
|
72 |
misc |
124 |
class mod_fastcgi inherits base { |
73 |
|
|
package { "apache-mod_fastcgi": |
74 |
|
|
ensure => installed |
75 |
|
|
} |
76 |
|
|
} |
77 |
misc |
84 |
|
78 |
misc |
192 |
class mod_ssl inherits base { |
79 |
misc |
487 |
file { "/etc/ssl/apache/": |
80 |
|
|
ensure => directory |
81 |
|
|
} |
82 |
|
|
|
83 |
misc |
192 |
package { "apache-mod_ssl": |
84 |
|
|
ensure => installed |
85 |
|
|
} |
86 |
boklm |
1245 |
|
87 |
|
|
file { "01_default_ssl_vhost.conf": |
88 |
|
|
path => '/etc/httpd/conf/vhosts.d/01_default_ssl_vhost.conf', |
89 |
|
|
ensure => "present", |
90 |
|
|
owner => root, |
91 |
|
|
group => root, |
92 |
|
|
mode => 644, |
93 |
|
|
notify => Service['apache'], |
94 |
|
|
require => Package["apache-conf"], |
95 |
|
|
content => template("apache/01_default_ssl_vhost.conf") |
96 |
|
|
} |
97 |
misc |
192 |
} |
98 |
|
|
|
99 |
misc |
80 |
class mod_wsgi inherits base { |
100 |
|
|
package { "apache-mod_wsgi": |
101 |
|
|
ensure => installed |
102 |
|
|
} |
103 |
misc |
182 |
|
104 |
misc |
201 |
file { "/usr/local/lib/wsgi": |
105 |
misc |
182 |
ensure => directory, |
106 |
|
|
owner => root, |
107 |
|
|
group => root, |
108 |
|
|
mode => 644, |
109 |
|
|
} |
110 |
misc |
908 |
|
111 |
|
|
file { "/etc/httpd/conf.d/mod_wsgi.conf": |
112 |
|
|
ensure => present, |
113 |
|
|
owner => root, |
114 |
|
|
group => root, |
115 |
|
|
mode => 644, |
116 |
misc |
1065 |
require => Package['apache-conf'], |
117 |
misc |
1188 |
content => template('apache/mod_wsgi.conf'), |
118 |
misc |
1186 |
notify => Service['apache'], |
119 |
misc |
908 |
} |
120 |
|
|
|
121 |
misc |
80 |
} |
122 |
misc |
778 |
|
123 |
|
|
class mod_proxy inherits base { |
124 |
|
|
package { "apache-mod_proxy": |
125 |
|
|
ensure => installed |
126 |
|
|
} |
127 |
|
|
} |
128 |
misc |
167 |
|
129 |
misc |
929 |
class mod_public_html inherits base { |
130 |
|
|
package { "apache-mod_public_html": |
131 |
|
|
ensure => installed |
132 |
|
|
} |
133 |
|
|
} |
134 |
|
|
|
135 |
dams |
1021 |
class mod_deflate inherits base { |
136 |
|
|
package { "apache-mod_deflate": |
137 |
|
|
ensure => installed |
138 |
|
|
} |
139 |
|
|
} |
140 |
|
|
|
141 |
misc |
928 |
define vhost_base($content = '', |
142 |
|
|
$location = '/dev/null', |
143 |
|
|
$use_ssl = false, |
144 |
misc |
930 |
$vhost = false, |
145 |
misc |
932 |
$aliases = {}, |
146 |
misc |
935 |
$server_aliases = [], |
147 |
misc |
930 |
$enable_public_html = false) { |
148 |
boklm |
1464 |
include apache::base |
149 |
misc |
928 |
if ! $vhost { |
150 |
|
|
$real_vhost = $name |
151 |
|
|
} else { |
152 |
|
|
$real_vhost = $vhost |
153 |
misc |
176 |
} |
154 |
misc |
167 |
|
155 |
misc |
489 |
if $use_ssl { |
156 |
|
|
include apache::mod_ssl |
157 |
boklm |
1248 |
if $wildcard_sslcert != 'true' { |
158 |
boklm |
1237 |
openssl::self_signed_cert{ "$real_vhost": |
159 |
|
|
directory => "/etc/ssl/apache/", |
160 |
|
|
before => File["$filename"], |
161 |
|
|
} |
162 |
|
|
} |
163 |
misc |
489 |
} |
164 |
|
|
|
165 |
misc |
930 |
if $enable_public_html { |
166 |
|
|
include apache::mod_public_html |
167 |
|
|
} |
168 |
|
|
|
169 |
misc |
928 |
$filename = "$name.conf" |
170 |
|
|
file { "$filename": |
171 |
|
|
path => "/etc/httpd/conf/vhosts.d/$filename", |
172 |
misc |
167 |
ensure => "present", |
173 |
|
|
owner => root, |
174 |
|
|
group => root, |
175 |
|
|
mode => 644, |
176 |
|
|
notify => Service['apache'], |
177 |
misc |
1065 |
require => Package['apache-conf'], |
178 |
misc |
928 |
content => template("apache/vhost_base.conf") |
179 |
|
|
} |
180 |
|
|
} |
181 |
|
|
|
182 |
|
|
define vhost_redirect_ssl() { |
183 |
|
|
vhost_base { "redirect_ssl_$name": |
184 |
|
|
vhost => $name, |
185 |
|
|
content => template("apache/vhost_ssl_redirect.conf") |
186 |
|
|
} |
187 |
|
|
} |
188 |
|
|
|
189 |
|
|
define vhost_catalyst_app($script, $location = '', $process = 4, $use_ssl = false) { |
190 |
|
|
|
191 |
|
|
include apache::mod_fastcgi |
192 |
|
|
vhost_base { $name: |
193 |
|
|
use_ssl => $use_ssl, |
194 |
misc |
167 |
content => template("apache/vhost_catalyst_app.conf") |
195 |
|
|
} |
196 |
|
|
} |
197 |
misc |
182 |
|
198 |
misc |
1193 |
define vhost_django_app($module = false, $module_path = false, $use_ssl = false, $aliases= {}) { |
199 |
misc |
182 |
include apache::mod_wsgi |
200 |
misc |
928 |
vhost_base { $name: |
201 |
misc |
934 |
use_ssl => $use_ssl, |
202 |
misc |
1193 |
content => template("apache/vhost_django_app.conf"), |
203 |
|
|
aliases => $aliases, |
204 |
misc |
621 |
} |
205 |
misc |
928 |
|
206 |
misc |
612 |
# module is a ruby reserved keyword, cannot be used in templates |
207 |
|
|
$django_module = $module |
208 |
misc |
182 |
file { "$name.wsgi": |
209 |
misc |
201 |
path => "/usr/local/lib/wsgi/$name.wsgi", |
210 |
misc |
182 |
ensure => "present", |
211 |
|
|
owner => root, |
212 |
|
|
group => root, |
213 |
|
|
mode => 755, |
214 |
|
|
notify => Service['apache'], |
215 |
|
|
content => template("apache/django.wsgi") |
216 |
|
|
} |
217 |
|
|
} |
218 |
boklm |
280 |
|
219 |
misc |
935 |
define vhost_wsgi($wsgi_path, $aliases = {}, $server_aliases = []) { |
220 |
misc |
812 |
include apache::mod_wsgi |
221 |
misc |
933 |
vhost_base { $name: |
222 |
|
|
aliases => $aliases, |
223 |
misc |
935 |
server_aliases => $server_aliases, |
224 |
misc |
812 |
content => template("apache/vhost_wsgi.conf") |
225 |
|
|
} |
226 |
|
|
} |
227 |
|
|
|
228 |
boklm |
280 |
define vhost_other_app($vhost_file) { |
229 |
misc |
412 |
include apache::base |
230 |
boklm |
280 |
file { "$name.conf": |
231 |
|
|
path => "/etc/httpd/conf/vhosts.d/$name.conf", |
232 |
|
|
ensure => "present", |
233 |
|
|
owner => root, |
234 |
|
|
group => root, |
235 |
|
|
mode => 644, |
236 |
|
|
notify => Service['apache'], |
237 |
misc |
1065 |
require => Package['apache-conf'], |
238 |
boklm |
280 |
content => template($vhost_file) |
239 |
|
|
} |
240 |
|
|
} |
241 |
|
|
|
242 |
misc |
742 |
define vhost_simple($location) { |
243 |
|
|
include apache::base |
244 |
misc |
928 |
vhost_base { $name: |
245 |
|
|
location => $location, |
246 |
|
|
} |
247 |
misc |
742 |
} |
248 |
|
|
|
249 |
boklm |
1319 |
define vhost_redirect($url, |
250 |
|
|
$vhost = false, |
251 |
|
|
$use_ssl = false) { |
252 |
misc |
931 |
include apache::base |
253 |
|
|
vhost_base { $name: |
254 |
boklm |
1319 |
use_ssl => $use_ssl, |
255 |
|
|
vhost => $vhost, |
256 |
misc |
931 |
content => template("apache/vhost_redirect.conf"), |
257 |
|
|
} |
258 |
|
|
} |
259 |
|
|
|
260 |
misc |
1103 |
define vhost_reverse_proxy($url, |
261 |
|
|
$vhost = false, |
262 |
|
|
$use_ssl = false) { |
263 |
misc |
778 |
include apache::mod_proxy |
264 |
misc |
928 |
vhost_base { $name: |
265 |
misc |
1102 |
use_ssl => $use_ssl, |
266 |
misc |
1103 |
vhost => $vhost, |
267 |
misc |
778 |
content => template("apache/vhost_reverse_proxy.conf") |
268 |
misc |
928 |
} |
269 |
misc |
778 |
} |
270 |
|
|
|
271 |
boklm |
280 |
define webapp_other($webapp_file) { |
272 |
misc |
422 |
include apache::base |
273 |
boklm |
280 |
$webappname = $name |
274 |
|
|
file { "webapp_$name.conf": |
275 |
|
|
path => "/etc/httpd/conf/webapps.d/$webappname.conf", |
276 |
|
|
ensure => "present", |
277 |
|
|
owner => root, |
278 |
|
|
group => root, |
279 |
|
|
mode => 644, |
280 |
|
|
notify => Service['apache'], |
281 |
misc |
1065 |
require => Package['apache-conf'], |
282 |
boklm |
280 |
content => template($webapp_file) |
283 |
|
|
} |
284 |
|
|
} |
285 |
misc |
80 |
} |