diff options
Diffstat (limited to 'modules/apache')
-rw-r--r-- | modules/apache/manifests/var.pp | 5 | ||||
-rw-r--r-- | modules/apache/templates/00_default_vhosts.conf | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/modules/apache/manifests/var.pp b/modules/apache/manifests/var.pp index 294af458..2c33a23f 100644 --- a/modules/apache/manifests/var.pp +++ b/modules/apache/manifests/var.pp @@ -1,9 +1,12 @@ # $httpdlogs_rotate: # number of time the log file are rotated before being removed +# $default_vhost_redirect: +# URL to redirect to in case of unknown vhost class apache::var( $httpdlogs_rotate = '24', $apache_user = 'apache', - $apache_group = 'apache' + $apache_group = 'apache', + $default_vhost_redirect = '' ) { if ($::lsbdistrelease == '1') or ($::lsbdistid == 'MandrivaLinux') { $pkg_conf = 'apache-conf' diff --git a/modules/apache/templates/00_default_vhosts.conf b/modules/apache/templates/00_default_vhosts.conf index a1afe9ca..9a5f586c 100644 --- a/modules/apache/templates/00_default_vhosts.conf +++ b/modules/apache/templates/00_default_vhosts.conf @@ -3,5 +3,13 @@ <Location /> Allow from all </Location> - Redirect / http://www.<%= @domain %>/ + <%- + default_redirect = scope.lookupvar('apache::var::default_vhost_redirect') + if default_redirect == '' + -%> + Redirect 404 / + ErrorDocument 404 "Page Not Found" + <%- else -%> + Redirect / <%= default_redirect %> + <%- end -%> </VirtualHost> |