1 |
class apache { |
class apache { |
2 |
|
|
|
$vhost_dir = "/etc/httpd/conf/vhosts.d" |
|
|
$wsgi_dir = "/usr/local/lib/wsgi" |
|
|
|
|
3 |
class base { |
class base { |
4 |
package { "apache-mpm-prefork": |
package { "apache-mpm-prefork": |
5 |
alias => apache, |
alias => apache, |
59 |
ensure => installed |
ensure => installed |
60 |
} |
} |
61 |
|
|
62 |
file { $wsgi_dir: |
file { "/usr/local/lib/wsgi": |
63 |
ensure => directory, |
ensure => directory, |
64 |
owner => root, |
owner => root, |
65 |
group => root, |
group => root, |
69 |
|
|
70 |
define vhost_redirect_ssl() { |
define vhost_redirect_ssl() { |
71 |
file { "redirect_ssl_$name.conf": |
file { "redirect_ssl_$name.conf": |
72 |
path => "$vhost_dir/redirect_ssl_$name.conf", |
path => "/etc/httpd/conf/vhosts.d/redirect_ssl_$name.conf", |
73 |
ensure => "present", |
ensure => "present", |
74 |
owner => root, |
owner => root, |
75 |
group => root, |
group => root, |
84 |
include apache::mod_fastcgi |
include apache::mod_fastcgi |
85 |
|
|
86 |
file { "$name.conf": |
file { "$name.conf": |
87 |
path => "$vhost_dir/$name.conf", |
path => "/etc/httpd/conf/vhosts.d/$name.conf", |
88 |
ensure => "present", |
ensure => "present", |
89 |
owner => root, |
owner => root, |
90 |
group => root, |
group => root, |
98 |
include apache::mod_wsgi |
include apache::mod_wsgi |
99 |
|
|
100 |
file { "$name.conf": |
file { "$name.conf": |
101 |
path => "$vhost_dir/$name.conf", |
path => "/etc/httpd/conf/vhosts.d/$name.conf", |
102 |
ensure => "present", |
ensure => "present", |
103 |
owner => root, |
owner => root, |
104 |
group => root, |
group => root, |
109 |
|
|
110 |
# fichier django wsgi |
# fichier django wsgi |
111 |
file { "$name.wsgi": |
file { "$name.wsgi": |
112 |
path => "$wsgi_dir/$name.wsgi", |
path => "/usr/local/lib/wsgi/$name.wsgi", |
113 |
ensure => "present", |
ensure => "present", |
114 |
owner => root, |
owner => root, |
115 |
group => root, |
group => root, |