separa directories

This commit is contained in:
Antonio J. Delgado 2023-03-27 12:11:51 +03:00
parent c7ff875c62
commit 50797e7693

View file

@ -28,7 +28,7 @@
ServerName {{ item.vhostname }} ServerName {{ item.vhostname }}
ServerAdmin {{ item.serveradmin|default("webmaster@" + item.vhostname ) }} ServerAdmin {{ item.serveradmin|default("webmaster@" + item.vhostname ) }}
{% if item.server_aliases is defined %} {% if item.server_aliases is defined %}
ServerAlias {% for alias in item.server_aliases %}{{ alias }} {% endfor %} ServerAlias {% for alias in item.server_aliases %}{{ alias }} {% endfor %}
{% endif %} {% endif %}
{% if item.aliases is defined %}{% for alias in item.aliases %} {% if item.aliases is defined %}{% for alias in item.aliases %}
@ -54,18 +54,19 @@
{% endif %} {% endif %}
AllowOverride All AllowOverride All
</Directory>{% endif %} </Directory>
{% endif %}
{% if item.directories is defined %}{% for directory in item.directories %} {% if item.directories is defined %}{% for directory in item.directories %}
<Directory "{{ directory.path }}"> <Directory "{{ directory.path }}">
{% if directory.options is defined %} {% if directory.options is defined %}
Options {% for option in directory.options %}{{ option }} {% endfor %} Options {% for option in directory.options %}{{ option }} {% endfor %}
{% endif %} {% endif %}
AllowOverride {{ directory.allow_override | default("All") }}
AllowOverride {{ directory.allow_override | default("All") }} Require {{ directory.require | default("all granted") }}
Require {{ directory.require | default("all granted") }} {{ directory.custom_code | default("") }}
{{ directory.custom_code | default("") }} </Directory>
</Directory>{% endfor %}{% endif %} {% endfor %}{% endif %}
{% if item.directoriesmatches is defined %}{% for directorymatch in item.directoriesmatches %} {% if item.directoriesmatches is defined %}{% for directorymatch in item.directoriesmatches %}
<DirectoryMatch "{{ directorymatch.path }}"> <DirectoryMatch "{{ directorymatch.path }}">
@ -73,10 +74,11 @@
Options {% for option in directorymatch.options %}{{ option }} {% endfor %} Options {% for option in directorymatch.options %}{{ option }} {% endfor %}
{% endif %} {% endif %}
AllowOverride {{ directorymatch.allow_override | default("All") }} AllowOverride {{ directorymatch.allow_override | default("All") }}
Require {{ directorymatch.require | default("all granted") }} Require {{ directorymatch.require | default("all granted") }}
{{ directorymatch.custom_code | default("") }} {{ directorymatch.custom_code | default("") }}
</DirectoryMatch>{% endfor %}{% endif %} </DirectoryMatch>
{% endfor %}{% endif %}
## Logging ## Logging
ErrorLog "/var/log/apache2/{{ item.vhostname }}_error_ssl.log" ErrorLog "/var/log/apache2/{{ item.vhostname }}_error_ssl.log"
@ -88,7 +90,6 @@
## Rewrite rules ## Rewrite rules
RewriteEngine On RewriteEngine On
## SSL directives ## SSL directives
SSLEngine on SSLEngine on
SSLCertificateFile "/etc/letsencrypt/live/{{ item.vhostname }}/fullchain.pem" SSLCertificateFile "/etc/letsencrypt/live/{{ item.vhostname }}/fullchain.pem"
@ -99,14 +100,14 @@
{% if item.ldap is defined %} {% if item.ldap is defined %}
## LDAP authentication ## LDAP authentication
<Location /> <Location />
AuthType Basic AuthType Basic
AuthName "Enter credentials" AuthName "Enter credentials"
AuthBasicProvider ldap AuthBasicProvider ldap
AuthLDAPGroupAttribute member AuthLDAPGroupAttribute member
AuthLDAPSubGroupClass group AuthLDAPSubGroupClass group
AuthLDAPGroupAttributeIsDN On AuthLDAPGroupAttributeIsDN On
AuthLDAPURL {{ item.ldap.url }} #ldap://ldap.koti.site/ou=People,ou=Users,dc=koti,dc=site?uid AuthLDAPURL {{ item.ldap.url }} #ldap://ldap.koti.site/ou=People,ou=Users,dc=koti,dc=site?uid
Require {{ item.ldap.require }} #valid-user Require {{ item.ldap.require }} #valid-user
</Location> </Location>
{% endif %} {% endif %}
@ -121,7 +122,7 @@
{% if item.custom_code is defined %} {% if item.custom_code is defined %}
## Custom fragment ## Custom fragment
{{ item.custom_code }} {{ item.custom_code }}
## End of custom fragment ## End of custom fragment
{% endif %} {% endif %}
</VirtualHost> </VirtualHost>