apache: Add support for port based SSL virtual hosts

This commit is contained in:
Ossi Salmi 2013-09-24 15:11:12 +03:00
parent 379ca62a5f
commit 53a0422843
4 changed files with 22 additions and 8 deletions

View file

@ -305,6 +305,18 @@ define apache::sslsite($first=false, $hsts=false, $ipaddr="_default_", $root="",
include apache::mod::headers
}
if $name =~ /:([0-9]+)$/ {
$port = $1
if ! defined(Apache::Configfile["listen_${port}.conf"]) {
apache::configfile { "listen_${port}.conf":
http => false,
content => "Listen ${port}\n",
}
}
} else {
$port = "443"
}
case $::operatingsystem {
"debian","ubuntu": {
$apache_ssldir = "/etc/ssl"
@ -312,6 +324,7 @@ define apache::sslsite($first=false, $hsts=false, $ipaddr="_default_", $root="",
first => $first,
hsts => $hsts,
ipaddr => $ipaddr,
port => $port,
root => $root,
ssl_cert => $ssl_cert,
ssl_key => $ssl_key,
@ -326,6 +339,7 @@ define apache::sslsite($first=false, $hsts=false, $ipaddr="_default_", $root="",
first => $first,
hsts => $hsts,
ipaddr => $ipaddr,
port => $port,
root => $root,
ssl_cert => $ssl_cert,
ssl_key => $ssl_key,