From f2deb21f9f570824cb0ac4b2158f083df62e9252 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Tue, 12 Dec 2017 14:35:50 +0000 Subject: [PATCH] vhost --- tasks/main.yml | 9 +++++++++ templates/default-vhost.j2 | 23 +++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 4705dee..ee0e361 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,6 +2,15 @@ - include: setup_Debian.yml +- name: enable modules + apache2_module: + name: "{{item}}" + state: present + with_items: + - php7.0 + - rewrite + - ssl + - name: default vhost template: src: default-vhost.j2 diff --git a/templates/default-vhost.j2 b/templates/default-vhost.j2 index d96a3f4..9404856 100644 --- a/templates/default-vhost.j2 +++ b/templates/default-vhost.j2 @@ -1,10 +1,29 @@ + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + 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 - DocumentRoot /var/www/html/ - + + DocumentRoot /var/www/default/ + Options -Indexes + + #RewriteEngine On + #RewriteCond %{REQUEST_FILENAME} !-f + #RewriteCond %{REQUEST_FILENAME} !-d + #RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] + # vim: syntax=apache ts=4 sw=4 sts=4 sr noet