]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Support for custom http and https ports
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 16 Mar 2014 17:22:31 +0000 (14:22 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 16 Mar 2014 17:22:31 +0000 (14:22 -0300)
manifests/init.pp
manifests/site.pp
templates/default.erb
templates/error.erb
templates/site.erb

index 22d4bc6bfd5b1a5c96b8f08fdbb329a53b9806bf..9caf35efc4b297e62567c78c1c896649f87c0b06 100644 (file)
@@ -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
index 4179c72f1cb8ef5b33bd92d61118576bdce8b8c0..cda16627dd44ac34e6bc881d61fc91abefd35b0d 100644 (file)
@@ -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,
index a4361b7269ed3111853157edf58a14f7b67f6e88..8b49c771fefc66385bdcbc6c19fb5edff00a560c 100644 (file)
@@ -1,5 +1,5 @@
 # begin vhost for <%= fqdn %>
-<VirtualHost *:80>
+<VirtualHost *:<%= scope.lookupvar('apache::http_port') %>>
    ServerName <%= fqdn %>
    DocumentRoot <%= scope.lookupvar('apache::default_folder') %>
       
index 70693feb9f6f54effcab4ec36a263ec12b4b7dcb..9f13fd9e4d29bdb12dd3623fce74437b1a864604 100644 (file)
@@ -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') %>
index 628732602cd1a75c606e457ee59f1be126164b2a..b044a2e36d438b9ee7fc6e70e8638ad76758656a 100644 (file)
@@ -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"