1 |
class apache { |
class apache { |
2 |
|
|
3 |
$vhost_dir = "/etc/httpd/conf/vhosts.d" |
$vhost_dir = "/etc/httpd/conf/vhosts.d" |
4 |
|
$wsgi_dir = "/usr/local/lib/wsgi" |
5 |
|
|
6 |
class base { |
class base { |
7 |
package { "apache-mpm-prefork": |
package { "apache-mpm-prefork": |
55 |
package { "apache-mod_wsgi": |
package { "apache-mod_wsgi": |
56 |
ensure => installed |
ensure => installed |
57 |
} |
} |
58 |
|
|
59 |
|
file { $wsgi_dir: |
60 |
|
ensure => directory, |
61 |
|
owner => root, |
62 |
|
group => root, |
63 |
|
mode => 644, |
64 |
|
} |
65 |
} |
} |
66 |
|
|
67 |
define vhost_redirect_ssl() { |
define vhost_redirect_ssl() { |
90 |
content => template("apache/vhost_catalyst_app.conf") |
content => template("apache/vhost_catalyst_app.conf") |
91 |
} |
} |
92 |
} |
} |
93 |
|
|
94 |
|
define vhost_django_app($module, $module_path = '/usr/share') { |
95 |
|
include apache::mod_wsgi |
96 |
|
|
97 |
|
file { "$name.conf": |
98 |
|
path => "$vhost_dir/$name.conf", |
99 |
|
ensure => "present", |
100 |
|
owner => root, |
101 |
|
group => root, |
102 |
|
mode => 644, |
103 |
|
notify => Service['apache'], |
104 |
|
content => template("apache/vhost_django_app.conf") |
105 |
|
} |
106 |
|
|
107 |
|
# fichier django wsgi |
108 |
|
file { "$name.wsgi": |
109 |
|
path => "$wsgi_dir/$name.wsgi", |
110 |
|
ensure => "present", |
111 |
|
owner => root, |
112 |
|
group => root, |
113 |
|
mode => 755, |
114 |
|
notify => Service['apache'], |
115 |
|
content => template("apache/django.wsgi") |
116 |
|
} |
117 |
|
} |
118 |
} |
} |