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 |
96 |
service { httpd: |
10 |
|
|
alias => apache, |
11 |
misc |
80 |
ensure => running, |
12 |
|
|
subscribe => [ Package['apache-mpm-prefork'] ], |
13 |
|
|
} |
14 |
misc |
117 |
|
15 |
|
|
file { "customization.conf": |
16 |
|
|
ensure => present, |
17 |
misc |
126 |
path => "/etc/httpd/conf.d/customization.conf", |
18 |
misc |
117 |
content => template("apache/customization.conf"), |
19 |
|
|
require => Package["apache"], |
20 |
|
|
notify => Service["apache"], |
21 |
|
|
owner => root, |
22 |
|
|
group => root, |
23 |
|
|
mode => 644, |
24 |
|
|
} |
25 |
boklm |
207 |
|
26 |
|
|
file { "00_default_vhosts.conf": |
27 |
|
|
path => "/etc/httpd/conf/vhosts.d/00_default_vhosts.conf", |
28 |
|
|
ensure => "present", |
29 |
|
|
owner => root, |
30 |
|
|
group => root, |
31 |
|
|
mode => 644, |
32 |
|
|
notify => Service['apache'], |
33 |
|
|
content => template("apache/00_default_vhosts.conf") |
34 |
|
|
} |
35 |
misc |
80 |
} |
36 |
|
|
|
37 |
|
|
class mod_php inherits base { |
38 |
|
|
package { "apache-mod_php": |
39 |
|
|
ensure => installed |
40 |
|
|
} |
41 |
|
|
} |
42 |
|
|
|
43 |
|
|
class mod_perl inherits base { |
44 |
|
|
package { "apache-mod_perl": |
45 |
|
|
ensure => installed |
46 |
|
|
} |
47 |
|
|
} |
48 |
|
|
|
49 |
misc |
84 |
class mod_fcgid inherits base { |
50 |
|
|
package { "apache-mod_fcgid": |
51 |
|
|
ensure => installed |
52 |
|
|
} |
53 |
|
|
} |
54 |
|
|
|
55 |
misc |
124 |
class mod_fastcgi inherits base { |
56 |
|
|
package { "apache-mod_fastcgi": |
57 |
|
|
ensure => installed |
58 |
|
|
} |
59 |
|
|
} |
60 |
misc |
84 |
|
61 |
misc |
192 |
class mod_ssl inherits base { |
62 |
|
|
package { "apache-mod_ssl": |
63 |
|
|
ensure => installed |
64 |
|
|
} |
65 |
|
|
} |
66 |
|
|
|
67 |
misc |
80 |
class mod_wsgi inherits base { |
68 |
|
|
package { "apache-mod_wsgi": |
69 |
|
|
ensure => installed |
70 |
|
|
} |
71 |
misc |
182 |
|
72 |
misc |
201 |
file { "/usr/local/lib/wsgi": |
73 |
misc |
182 |
ensure => directory, |
74 |
|
|
owner => root, |
75 |
|
|
group => root, |
76 |
|
|
mode => 644, |
77 |
|
|
} |
78 |
misc |
80 |
} |
79 |
misc |
167 |
|
80 |
misc |
176 |
define vhost_redirect_ssl() { |
81 |
|
|
file { "redirect_ssl_$name.conf": |
82 |
misc |
201 |
path => "/etc/httpd/conf/vhosts.d/redirect_ssl_$name.conf", |
83 |
misc |
176 |
ensure => "present", |
84 |
|
|
owner => root, |
85 |
|
|
group => root, |
86 |
|
|
mode => 644, |
87 |
|
|
notify => Service['apache'], |
88 |
|
|
content => template("apache/vhost_ssl_redirect.conf") |
89 |
|
|
} |
90 |
|
|
} |
91 |
misc |
167 |
|
92 |
misc |
194 |
define vhost_catalyst_app($script, $location = '', $process = 4, $use_ssl = false) { |
93 |
misc |
176 |
|
94 |
misc |
167 |
include apache::mod_fastcgi |
95 |
|
|
|
96 |
|
|
file { "$name.conf": |
97 |
misc |
201 |
path => "/etc/httpd/conf/vhosts.d/$name.conf", |
98 |
misc |
167 |
ensure => "present", |
99 |
|
|
owner => root, |
100 |
|
|
group => root, |
101 |
|
|
mode => 644, |
102 |
|
|
notify => Service['apache'], |
103 |
|
|
content => template("apache/vhost_catalyst_app.conf") |
104 |
|
|
} |
105 |
|
|
} |
106 |
misc |
182 |
|
107 |
|
|
define vhost_django_app($module, $module_path = '/usr/share') { |
108 |
|
|
include apache::mod_wsgi |
109 |
|
|
|
110 |
|
|
file { "$name.conf": |
111 |
misc |
201 |
path => "/etc/httpd/conf/vhosts.d/$name.conf", |
112 |
misc |
182 |
ensure => "present", |
113 |
|
|
owner => root, |
114 |
|
|
group => root, |
115 |
|
|
mode => 644, |
116 |
|
|
notify => Service['apache'], |
117 |
|
|
content => template("apache/vhost_django_app.conf") |
118 |
|
|
} |
119 |
|
|
|
120 |
|
|
# fichier django wsgi |
121 |
|
|
file { "$name.wsgi": |
122 |
misc |
201 |
path => "/usr/local/lib/wsgi/$name.wsgi", |
123 |
misc |
182 |
ensure => "present", |
124 |
|
|
owner => root, |
125 |
|
|
group => root, |
126 |
|
|
mode => 755, |
127 |
|
|
notify => Service['apache'], |
128 |
|
|
content => template("apache/django.wsgi") |
129 |
|
|
} |
130 |
|
|
} |
131 |
misc |
80 |
} |