1 |
class apache { |
2 |
|
3 |
$vhost_dir = "/etc/httpd/conf/vhosts.d" |
4 |
|
5 |
class base { |
6 |
package { "apache-mpm-prefork": |
7 |
alias => apache, |
8 |
ensure => installed |
9 |
} |
10 |
|
11 |
service { httpd: |
12 |
alias => apache, |
13 |
ensure => running, |
14 |
subscribe => [ Package['apache-mpm-prefork'] ], |
15 |
} |
16 |
|
17 |
file { "customization.conf": |
18 |
ensure => present, |
19 |
path => "/etc/httpd/conf.d/customization.conf", |
20 |
content => template("apache/customization.conf"), |
21 |
require => Package["apache"], |
22 |
notify => Service["apache"], |
23 |
owner => root, |
24 |
group => root, |
25 |
mode => 644, |
26 |
} |
27 |
} |
28 |
|
29 |
class mod_php inherits base { |
30 |
package { "apache-mod_php": |
31 |
ensure => installed |
32 |
} |
33 |
} |
34 |
|
35 |
class mod_perl inherits base { |
36 |
package { "apache-mod_perl": |
37 |
ensure => installed |
38 |
} |
39 |
} |
40 |
|
41 |
class mod_fcgid inherits base { |
42 |
package { "apache-mod_fcgid": |
43 |
ensure => installed |
44 |
} |
45 |
} |
46 |
|
47 |
class mod_fastcgi inherits base { |
48 |
package { "apache-mod_fastcgi": |
49 |
ensure => installed |
50 |
} |
51 |
} |
52 |
|
53 |
class mod_wsgi inherits base { |
54 |
package { "apache-mod_wsgi": |
55 |
ensure => installed |
56 |
} |
57 |
} |
58 |
|
59 |
define vhost_redirect_ssl() { |
60 |
file { "redirect_ssl_$name.conf": |
61 |
path => "$vhost_dir/redirect_ssl_$name.conf", |
62 |
ensure => "present", |
63 |
owner => root, |
64 |
group => root, |
65 |
mode => 644, |
66 |
notify => Service['apache'], |
67 |
content => template("apache/vhost_ssl_redirect.conf") |
68 |
} |
69 |
} |
70 |
|
71 |
define vhost_catalyst_app($script, $process = 4, $use_ssl = false) { |
72 |
|
73 |
include apache::mod_fastcgi |
74 |
|
75 |
file { "$name.conf": |
76 |
path => "$vhost_dir/$name.conf", |
77 |
ensure => "present", |
78 |
owner => root, |
79 |
group => root, |
80 |
mode => 644, |
81 |
notify => Service['apache'], |
82 |
content => template("apache/vhost_catalyst_app.conf") |
83 |
} |
84 |
} |
85 |
} |