1 |
class apache { |
2 |
define vhost_redirect_ssl() { |
3 |
apache::vhost::base { "redirect_ssl_$name": |
4 |
vhost => $name, |
5 |
content => template("apache/vhost_ssl_redirect.conf") |
6 |
} |
7 |
} |
8 |
|
9 |
define vhost_catalyst_app($script, $location = '', $process = 4, $use_ssl = false, $vhost = false) { |
10 |
|
11 |
include apache::mod::fastcgi |
12 |
apache::vhost::base { $name: |
13 |
vhost => $vhost, |
14 |
use_ssl => $use_ssl, |
15 |
content => template("apache/vhost_catalyst_app.conf"), |
16 |
} |
17 |
} |
18 |
|
19 |
define vhost_django_app($module = false, $module_path = false, $use_ssl = false, $aliases= {}) { |
20 |
include apache::mod::wsgi |
21 |
apache::vhost::base { $name: |
22 |
use_ssl => $use_ssl, |
23 |
content => template("apache/vhost_django_app.conf"), |
24 |
aliases => $aliases, |
25 |
} |
26 |
|
27 |
# module is a ruby reserved keyword, cannot be used in templates |
28 |
$django_module = $module |
29 |
file { "$name.wsgi": |
30 |
path => "/usr/local/lib/wsgi/$name.wsgi", |
31 |
mode => 755, |
32 |
notify => Service['apache'], |
33 |
content => template("apache/django.wsgi"), |
34 |
} |
35 |
} |
36 |
|
37 |
define vhost_wsgi($wsgi_path, $aliases = {}, $server_aliases = []) { |
38 |
include apache::mod::wsgi |
39 |
apache::vhost::base { $name: |
40 |
aliases => $aliases, |
41 |
server_aliases => $server_aliases, |
42 |
content => template("apache/vhost_wsgi.conf"), |
43 |
} |
44 |
} |
45 |
|
46 |
define vhost_other_app($vhost_file) { |
47 |
include apache::base |
48 |
apache::config { "/etc/httpd/conf/vhosts.d/$name.conf": |
49 |
content => template($vhost_file), |
50 |
} |
51 |
} |
52 |
|
53 |
define vhost_simple($location) { |
54 |
include apache::base |
55 |
apache::vhost::base { $name: |
56 |
location => $location, |
57 |
} |
58 |
} |
59 |
|
60 |
define vhost_redirect($url, |
61 |
$vhost = false, |
62 |
$use_ssl = false) { |
63 |
include apache::base |
64 |
apache::vhost::base { $name: |
65 |
use_ssl => $use_ssl, |
66 |
vhost => $vhost, |
67 |
content => template("apache/vhost_redirect.conf"), |
68 |
} |
69 |
} |
70 |
|
71 |
define vhost_reverse_proxy($url, |
72 |
$vhost = false, |
73 |
$use_ssl = false) { |
74 |
include apache::mod::proxy |
75 |
apache::vhost::base { $name: |
76 |
use_ssl => $use_ssl, |
77 |
vhost => $vhost, |
78 |
content => template("apache/vhost_reverse_proxy.conf") |
79 |
} |
80 |
} |
81 |
|
82 |
} |