Apache-Einrichtung des Aliases
This commit is contained in:
parent
2b518c2b2c
commit
6dcde84319
4 changed files with 52 additions and 0 deletions
34
files/apache_site.conf
Normal file
34
files/apache_site.conf
Normal file
|
@ -0,0 +1,34 @@
|
|||
<Macro NCSite $domain $pool>
|
||||
<VirtualHost *:80>
|
||||
|
||||
ServerName $domain
|
||||
DocumentRoot /data/nextcloud/$domain/
|
||||
Include /etc/apache2/conf-available/sao-cache.conf
|
||||
IncludeOptional /etc/apache2/conf-available/$domain.alias.conf
|
||||
|
||||
ProxyTimeout 900
|
||||
|
||||
<FilesMatch \.php$>
|
||||
SetHandler "proxy:unix:/run/php/php-fpm-$pool.sock|fcgi://$domain/"
|
||||
</FilesMatch>
|
||||
|
||||
<Proxy "fcgi://$domain/">
|
||||
</Proxy>
|
||||
|
||||
<Directory /data/nextcloud/$domain/>
|
||||
Require all granted
|
||||
AllowOverride All
|
||||
Options FollowSymLinks MultiViews
|
||||
<IfModule mod_dav.c>
|
||||
Dav off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
</Macro>
|
||||
|
||||
# Includieren der Variablen
|
||||
Include /etc/apache2/conf-available/nextcloud_sites.conf
|
||||
|
||||
UndefMacro NCSite
|
|
@ -15,3 +15,9 @@
|
|||
insertafter: "^Ansbile"
|
||||
line: "Use NCSite {{ instance.domain }} {{ instance.user }}"
|
||||
notify: reload apache
|
||||
|
||||
- name: "apache: {{ instance.alias }}: Alias einrichten"
|
||||
template:
|
||||
src: apache_alias.j2
|
||||
dest: "/etc/apache2/conf-available/{{ instance.domain }}.alias.conf"
|
||||
notify: reload apache
|
||||
|
|
|
@ -27,12 +27,23 @@
|
|||
loop_control:
|
||||
loop_var: instance
|
||||
|
||||
- name: "Apache: Vorlage für Seitenkonfiguration kopieren"
|
||||
copy:
|
||||
src: apache_site.conf
|
||||
dest: /etc/apache/sites-available/nextcloud.conf
|
||||
|
||||
- name: "Webserver einrichten"
|
||||
include_tasks: apache.yml
|
||||
loop: "{{ instances }}"
|
||||
loop_control:
|
||||
loop_var: instance
|
||||
|
||||
- name: "Apache: Seitenkonfiguration aktivieren"
|
||||
file:
|
||||
src: /etc/apache/sites-available/nextcloud.conf
|
||||
dest: /etc/apache/sites-enabled/nextcloud.conf
|
||||
state: link
|
||||
|
||||
- import_tasks: redis.yml
|
||||
|
||||
- name: "Nextcloud einrichten"
|
||||
|
|
1
templates/apache_alias.j2
Normal file
1
templates/apache_alias.j2
Normal file
|
@ -0,0 +1 @@
|
|||
ServerAlias {{ instance.alias }}
|
Loading…
Reference in a new issue