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