From e5e83b70b6956dcb7a7b8ada836f3771c24c199e Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Tue, 20 Aug 2019 14:04:31 +0000 Subject: [PATCH] fix error in default vhost configuration --- templates/default-vhost.j2 | 43 +++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/templates/default-vhost.j2 b/templates/default-vhost.j2 index 4ff6d4c..86310ae 100644 --- a/templates/default-vhost.j2 +++ b/templates/default-vhost.j2 @@ -1,33 +1,38 @@ +{{ ansible_managed | comment }} + + - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined + ServerName localhost + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined - DocumentRoot /var/www/default/ - - Options -Indexes - + DocumentRoot /var/www/default/ + + Options -Indexes + - SSLEngine on - SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem" - SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key" + SSLEngine on + SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem" + SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key" - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined - DocumentRoot /var/www/default/ - - Options -Indexes - + DocumentRoot /var/www/default/ + + Options -Indexes + - # redirect to https if file could not be found in /var/www/default/ - RewriteEngine On - RewriteRule ^\/\.well-known\/acme-challenge\/ - [L] - RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L] + # redirect to https if file could not be found in /var/www/default/ + RewriteEngine On + RewriteRule ^\/\.well-known\/acme-challenge\/ - [L] + RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]