From 554c74730ccf45fd0f76ad10b62f5c44fa684c0d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 2 Jan 2016 22:46:25 -0600 Subject: [PATCH] Actually fixes #28: Allow for virtualhost without documentroot. --- templates/vhosts-2.2.conf.j2 | 6 ++++++ templates/vhosts-2.4.conf.j2 | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/templates/vhosts-2.2.conf.j2 b/templates/vhosts-2.2.conf.j2 index 6fd67aa..4f922f4 100644 --- a/templates/vhosts-2.2.conf.j2 +++ b/templates/vhosts-2.2.conf.j2 @@ -14,12 +14,14 @@ {% if vhost.serveradmin is defined %} ServerAdmin {{ vhost.serveradmin }} {% endif %} +{% if vhost.documentroot is defined %} AllowOverride All Options -Indexes FollowSymLinks Order allow,deny Allow from all +{% endif %} {% if vhost.extra_parameters is defined %} {{ vhost.extra_parameters }} {% endif %} @@ -34,7 +36,9 @@ {% if vhost.serveralias is defined %} ServerAlias {{ vhost.serveralias }} {% endif %} +{% if vhost.documentroot is defined %} DocumentRoot {{ vhost.documentroot }} +{% endif %} SSLEngine on SSLCipherSuite {{ apache_ssl_cipher_suite }} @@ -49,12 +53,14 @@ {% if vhost.serveradmin is defined %} ServerAdmin {{ vhost.serveradmin }} {% endif %} +{% if vhost.documentroot is defined %} AllowOverride All Options -Indexes FollowSymLinks Order allow,deny Allow from all +{% endif %} {% if vhost.extra_parameters is defined %} {{ vhost.extra_parameters }} {% endif %} diff --git a/templates/vhosts-2.4.conf.j2 b/templates/vhosts-2.4.conf.j2 index 602cf3f..fe1b3b8 100644 --- a/templates/vhosts-2.4.conf.j2 +++ b/templates/vhosts-2.4.conf.j2 @@ -14,11 +14,13 @@ {% if vhost.serveradmin is defined %} ServerAdmin {{ vhost.serveradmin }} {% endif %} +{% if vhost.documentroot is defined %} AllowOverride All Options -Indexes +FollowSymLinks Require all granted +{% endif %} {% if vhost.extra_parameters is defined %} {{ vhost.extra_parameters }} {% endif %} @@ -33,7 +35,9 @@ {% if vhost.serveralias is defined %} ServerAlias {{ vhost.serveralias }} {% endif %} +{% if vhost.documentroot is defined %} DocumentRoot {{ vhost.documentroot }} +{% endif %} SSLEngine on SSLCipherSuite {{ apache_ssl_cipher_suite }} @@ -49,11 +53,13 @@ {% if vhost.serveradmin is defined %} ServerAdmin {{ vhost.serveradmin }} {% endif %} +{% if vhost.documentroot is defined %} AllowOverride All Options -Indexes +FollowSymLinks Require all granted +{% endif %} {% if vhost.extra_parameters is defined %} {{ vhost.extra_parameters }} {% endif %}