Add vhost config

This commit is contained in:
Antonio J. Delgado 2023-02-15 15:28:06 +02:00
parent a29b27ee77
commit fc82d80ae3
3 changed files with 27 additions and 2 deletions

View file

@ -14,6 +14,9 @@ vhosts: []
# aliases:
# - dest: my_page
# src: /var/www/my_page
# scriptaliases:
# - dest: my_page
# src: /var/www/my_page
# directories:
# - path: /var/www/host.example.org/custom_dir
# options:
@ -22,6 +25,14 @@ vhosts: []
# allow_override: None
# require: 'all granted'
# custom_code: ""
# directoriesmatches:
# - path: /var/www/host.example.org/custom_dir
# options:
# - '-Indexes'
# - '-FollowSymLinks'
# allow_override: None
# require: 'all granted'
# custom_code: ""
# custom_code: ""
# ldap:
# url: ldap://ldap.example.org/ou=People,ou=Users,dc=example,dc=org?uid

View file

@ -17,6 +17,6 @@ galaxy_info:
- focal
- jammy
galaxy_tags: []# TODO
galaxy_tags: [] # TODO
dependencies: []
dependencies: []

View file

@ -35,6 +35,9 @@
Alias /{{ alias.dest }} "{{ alias.src }}"
{% endfor %}{% endif %}
{% if item.scriptaliases is defined %}{% for alias in item.scriptaliases %}
ScriptAlias /{{ alias.dest }} "{{ alias.src }}"
{% endfor %}{% endif %}
{% if item.docroot is defined %} ## Vhost docroot
DocumentRoot "{{ item.docroot | default("/var/www/" + item.vhostname ) }}/"
@ -64,6 +67,17 @@
{{ directory.custom_code | default("") }}
</Directory>{% endfor %}{% endif %}
{% if item.directoriesmatches is defined %}{% for directorymatch in item.directoriesmatches %}
<DirectoryMatch "{{ directorymatch.path }}">
{% if directorymatch.options is defined %}
Options {% for option in directorymatch.options %}{{ option }} {% endfor %}
{% endif %}
AllowOverride {{ directorymatch.allow_override | default("All") }}
Require {{ directorymatch.require | default("all granted") }}
{{ directorymatch.custom_code | default("") }}
</Directory>{% endfor %}{% endif %}
## Logging
ErrorLog "/var/log/apache2/{{ item.vhostname }}_error_ssl.log"
ServerSignature Off