apache: Added support for proxy http sites.

This commit is contained in:
Timo Mkinen 2013-05-07 10:03:22 +03:00
parent f9e719d33e
commit 945a9f2af3
4 changed files with 61 additions and 28 deletions

View file

@ -45,7 +45,7 @@ class apache::redhat::server {
}
define apache::redhat::site($aliases, $root, $redirect) {
define apache::redhat::site($aliases, $root, $redirect, $proxy) {
if $name == "default" {
$site_fqdn = $homename
@ -57,19 +57,21 @@ define apache::redhat::site($aliases, $root, $redirect) {
$site_confdir = "/etc/httpd/site.http.d/${site_fqdn}.d"
if !$redirect {
if $root {
file { "/srv/www/http/${site_fqdn}":
ensure => link,
target => $root,
before => File[$site_conf],
}
} else {
file { "/srv/www/http/${site_fqdn}":
ensure => directory,
mode => "0755",
owner => root,
group => root,
before => File[$site_conf],
if !$proxy {
if $root {
file { "/srv/www/http/${site_fqdn}":
ensure => link,
target => $root,
before => File[$site_conf],
}
} else {
file { "/srv/www/http/${site_fqdn}":
ensure => directory,
mode => "0755",
owner => root,
group => root,
before => File[$site_conf],
}
}
}
@ -96,6 +98,10 @@ define apache::redhat::site($aliases, $root, $redirect) {
File[$site_conf] {
content => "<VirtualHost *:80>\n ServerName ${site_fqdn}\n Redirect permanent / ${redirect}\n</VirtualHost>\n",
}
} elsif $proxy {
File[$site_conf] {
content => template("apache/proxy.http.conf.erb"),
}
} else {
File[$site_conf] {
content => template("apache/site.http.conf.erb"),