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