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"
|
insertafter: "^Ansbile"
|
||||||
line: "Use NCSite {{ instance.domain }} {{ instance.user }}"
|
line: "Use NCSite {{ instance.domain }} {{ instance.user }}"
|
||||||
notify: reload apache
|
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
|
||||||
|
|
|
@ -26,6 +26,11 @@
|
||||||
loop: "{{ instances }}"
|
loop: "{{ instances }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: instance
|
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"
|
- name: "Webserver einrichten"
|
||||||
include_tasks: apache.yml
|
include_tasks: apache.yml
|
||||||
|
@ -33,6 +38,12 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: instance
|
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
|
- import_tasks: redis.yml
|
||||||
|
|
||||||
- name: "Nextcloud einrichten"
|
- 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