From ddcee951befa7eb91d1d3801e673f6d6347bebf6 Mon Sep 17 00:00:00 2001 From: Faris AL-Otaibi Date: Sat, 13 Jul 2024 05:26:40 +0300 Subject: [PATCH] Added directory lists --- templates/vhosts.conf.j2 | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/templates/vhosts.conf.j2 b/templates/vhosts.conf.j2 index 37d9c63..4667aa9 100644 --- a/templates/vhosts.conf.j2 +++ b/templates/vhosts.conf.j2 @@ -14,6 +14,7 @@ {% if vhost.serveradmin is defined %} ServerAdmin {{ vhost.serveradmin }} {% endif %} + {% if vhost.documentroot is defined %} AllowOverride {{ vhost.allow_override | default(apache_allow_override) }} @@ -27,6 +28,27 @@ {% endif %} {% endif %} + +{% if vhost.directory_list is defined -%} +{% for dir in vhost.directory_list %} + + {% if vhost.directory_list[dir].allow_override is defined %} + AllowOverride {{ vhost.directory_list[dir].allow_override }} + {% endif %} + + {% if vhost.directory_list[dir].options is defined %} + Options {{ vhost.directory_list[dir].options }} + {% endif %} +{% if apache_vhosts_version == "2.2" %} + Order allow,deny + Allow from all +{% else %} + Require all granted +{% endif %} + +{% endfor %} +{% endif %} + {% if vhost.extra_parameters is defined %} {{ vhost.extra_parameters | indent(width=2, first=True) }} {% endif %} @@ -62,6 +84,7 @@ {% if vhost.serveradmin is defined %} ServerAdmin {{ vhost.serveradmin }} {% endif %} + {% if vhost.documentroot is defined %} AllowOverride {{ vhost.allow_override | default(apache_allow_override) }} @@ -75,6 +98,27 @@ {% endif %} {% endif %} + +{% if vhost.directory_list is defined -%} +{% for dir in vhost.directory_list %} + + {% if vhost.directory_list[dir].allow_override is defined %} + AllowOverride {{ vhost.directory_list[dir].allow_override }} + {% endif %} + + {% if vhost.directory_list[dir].options is defined %} + Options {{ vhost.directory_list[dir].options }} + {% endif %} +{% if apache_vhosts_version == "2.2" %} + Order allow,deny + Allow from all +{% else %} + Require all granted +{% endif %} + +{% endfor %} +{% endif %} + {% if vhost.extra_parameters is defined %} {{ vhost.extra_parameters | indent(width=2, first=True) }} {% endif %}