vanhempi
commit
f2deb21f9f
2 muutettua tiedostoa jossa 30 lisäystä ja 2 poistoa
  1. +9
    -0
      tasks/main.yml
  2. +21
    -2
      templates/default-vhost.j2

+ 9
- 0
tasks/main.yml Näytä tiedosto

@@ -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


+ 21
- 2
templates/default-vhost.j2 Näytä tiedosto

@@ -1,10 +1,29 @@
<VirtualHost *:443>

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"

</VirtualHost>

<VirtualHost *:80>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
DocumentRoot /var/www/html/
<Directory "/var/www/html/">

DocumentRoot /var/www/default/
<Directory "/var/www/default/">
Options -Indexes
</Directory>

#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Loading…
Peruuta
Tallenna