add solution

This commit is contained in:
2026-06-25 10:26:45 +02:00
parent 450421e5f6
commit f02f3803e0
15 changed files with 268 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
<h1>hello World {{ apache_server_name }} </h1>
+27
View File
@@ -0,0 +1,27 @@
{% for vhost in apache_vhosts %}
<VirtualHost *:80>
ServerName {{ vhost.server_name }}
{% for alias in vhost.server_alias %}
ServerAlias {{ alias }}
{% endfor %}
ServerAlias {{ inventory_hostname }}
DocumentRoot {{ vhost.document_root }}
CustomLog {{ apache_log_dir }}/{{ vhost.server_name }}_access.log combined
ErrorLog {{ apache_log_dir }}/{{ vhost.server_name }}_error.log
<Directory />
Options none
Allowoverride none
Require all denied
</Directory>
<Directory {{ vhost.document_root }}
Require all granted
</Directory>
<Directory {{ vhost.document_root }}/Private>
Options indexes
AuthName "stop"
AuthType Basic
AuthUserFile {{ apache_config_dir }}/passwd
require valid-user
</Directory>
</VirtualHost>