summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-16 14:22:31 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-16 14:22:31 -0300
commit2ebc136f0f432f5fdeeffab01198289b657332b0 (patch)
tree4c0b10038d59e08736f94b01eac4d4801df98d4c
parentaf91d2e0abe4174440b132ea4d046a69b97214ae (diff)
downloadpuppet-apache-2ebc136f0f432f5fdeeffab01198289b657332b0.tar.gz
puppet-apache-2ebc136f0f432f5fdeeffab01198289b657332b0.tar.bz2
Support for custom http and https ports
-rw-r--r--manifests/init.pp4
-rw-r--r--manifests/site.pp2
-rw-r--r--templates/default.erb2
-rw-r--r--templates/error.erb2
-rw-r--r--templates/site.erb4
5 files changed, 8 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 22d4bc6..9caf35e 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -37,7 +37,9 @@ class apache(
$default_folder = '/var/www/data',
$server_name = $hostname,
$https_proxy = 'no',
- $remote_addr = false
+ $remote_addr = false,
+ $http_port = '80',
+ $https_port = '443',
) {
include ssl
diff --git a/manifests/site.pp b/manifests/site.pp
index 4179c72..cda1662 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -52,7 +52,7 @@ define apache::site(
$hidden_enabled = hiera('apache::site::hidden', false)
if $hidden_service == true and $hidden_enabled == true {
tor::daemon::hidden_service { $title:
- ports => [ "80 127.0.0.1:80" ],
+ ports => [ "80 127.0.0.1:${apache::http_port}" ],
data_dir => "${tor::daemon::data_dir}/hidden",
require => File["${tor::daemon::data_dir}/hidden"],
ensure => $ensure,
diff --git a/templates/default.erb b/templates/default.erb
index a4361b7..8b49c77 100644
--- a/templates/default.erb
+++ b/templates/default.erb
@@ -1,5 +1,5 @@
# begin vhost for <%= fqdn %>
-<VirtualHost *:80>
+<VirtualHost *:<%= scope.lookupvar('apache::http_port') %>>
ServerName <%= fqdn %>
DocumentRoot <%= scope.lookupvar('apache::default_folder') %>
diff --git a/templates/error.erb b/templates/error.erb
index 70693fe..9f13fd9 100644
--- a/templates/error.erb
+++ b/templates/error.erb
@@ -1,5 +1,5 @@
# vhost to handle inexistent vhosts
-<VirtualHost *:80>
+<VirtualHost *:<%= scope.lookupvar('apache::http_port') %>>
ServerName error.<%= hosting_domain %>
ServerAlias *.<%= hosting_domain %>
DocumentRoot <%= scope.lookupvar('apache::error_folder') %>
diff --git a/templates/site.erb b/templates/site.erb
index 6287326..b044a2e 100644
--- a/templates/site.erb
+++ b/templates/site.erb
@@ -1,5 +1,5 @@
# begin vhost for <%= title %>
-<VirtualHost <%= listen %>:80>
+<VirtualHost <%= listen %>:<%= scope.lookupvar('apache::http_port') %>>
ServerName <%= title %>.<%= hosting_domain %>
<% if server_alias != false %> ServerAlias <%= server_alias %><% end %>
DocumentRoot <%= docroot %>
@@ -37,7 +37,7 @@
# end vhost for <%= title %>
<% if ssl == true %>
# begin ssl vhost for <%= title %>
-<VirtualHost <%= listen %>:443>
+<VirtualHost <%= listen %>:<%= scope.lookupvar('apache::https_port') %>>
# Use HTTP Strict Transport Security to force client to use secure connections only
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"