From bcda278c2ab74795857cf9bcb9184268e8a28923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C3=A9cureuil?= Date: Mon, 17 Apr 2017 01:23:20 +0200 Subject: Allow to not use Location directive in apache ( but keep past use by default) --- modules/apache/manifests/vhost/base.pp | 3 ++- modules/apache/templates/vhost_base.conf | 2 ++ modules/bugzilla/manifests/init.pp | 1 + modules/bugzilla/templates/vhost.conf | 12 ++++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/apache/manifests/vhost/base.pp b/modules/apache/manifests/vhost/base.pp index 1ddc00cc..27a19998 100644 --- a/modules/apache/manifests/vhost/base.pp +++ b/modules/apache/manifests/vhost/base.pp @@ -7,7 +7,8 @@ define apache::vhost::base ($content = '', $access_logfile = false, $error_logfile = false, $options = [], - $enable_public_html = false) { + $enable_public_html = false, + $enable_location = true) { include apache::base $httpd_logdir = '/var/log/httpd' $filename = "${name}.conf" diff --git a/modules/apache/templates/vhost_base.conf b/modules/apache/templates/vhost_base.conf index c6feade5..84c8f918 100644 --- a/modules/apache/templates/vhost_base.conf +++ b/modules/apache/templates/vhost_base.conf @@ -39,6 +39,7 @@ end <%- end -%> +<%- if enable_location -%> Require all granted @@ -47,5 +48,6 @@ end Allow from all +<%- end -%> diff --git a/modules/bugzilla/manifests/init.pp b/modules/bugzilla/manifests/init.pp index 3e36fb42..373187d7 100755 --- a/modules/bugzilla/manifests/init.pp +++ b/modules/bugzilla/manifests/init.pp @@ -61,6 +61,7 @@ class bugzilla { use_ssl => true, location => $vhost_root, vhost => $bugs_vhost, + enable_location => false, } git::snapshot { $bugzilla_location: diff --git a/modules/bugzilla/templates/vhost.conf b/modules/bugzilla/templates/vhost.conf index 79eab9fb..b320285e 100644 --- a/modules/bugzilla/templates/vhost.conf +++ b/modules/bugzilla/templates/vhost.conf @@ -1,2 +1,14 @@ RewriteEngine On RewriteRule ^/([0-9]+)$ /show_bug.cgi?id=$1 [R=301,L] + + + Require all granted + + + + + AllowOverride all + AddHandler cgi-script .cgi + Options +ExecCGI +FollowSymLinks + DirectoryIndex index.cgi index.html + -- cgit v1.2.1