rendu compatible le rôle avec apache pour nextcloud01
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
This commit is contained in:
parent
5fa7f4809c
commit
f1485451ef
|
@ -8,3 +8,8 @@
|
||||||
service:
|
service:
|
||||||
name: nginx
|
name: nginx
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
|
- name: reload apache
|
||||||
|
service:
|
||||||
|
name: apache2
|
||||||
|
state: reloaded
|
|
@ -45,7 +45,14 @@
|
||||||
|
|
||||||
- include: archive.yml
|
- include: archive.yml
|
||||||
|
|
||||||
- include: vhost.yml
|
- name: Check if Apache or Nginx
|
||||||
|
service_facts:
|
||||||
|
|
||||||
|
- include: vhost-nginx.yml
|
||||||
|
when: "'nginx.service' in services"
|
||||||
|
|
||||||
|
- include: vhost-apache.yml
|
||||||
|
when: "'apache2.service' in services"
|
||||||
|
|
||||||
- include: mysql.yml
|
- include: mysql.yml
|
||||||
|
|
||||||
|
|
24
webapps/nextcloud/tasks/vhost-apache.yml
Normal file
24
webapps/nextcloud/tasks/vhost-apache.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
- block:
|
||||||
|
- name: Copy Apache vhost
|
||||||
|
template:
|
||||||
|
src: apache.conf.j2
|
||||||
|
dest: "/etc/apache2/sites-available/{{ nextcloud_instance_name }}.conf"
|
||||||
|
mode: "0640"
|
||||||
|
notify: reload apache
|
||||||
|
tags:
|
||||||
|
- nextcloud
|
||||||
|
|
||||||
|
- name: Enable Apache vhost
|
||||||
|
file:
|
||||||
|
src: "/etc/apache2/sites-available/{{ nextcloud_instance_name }}.conf"
|
||||||
|
dest: "/etc/apache2/sites-enabled/{{ nextcloud_instance_name }}.conf"
|
||||||
|
state: link
|
||||||
|
notify: reload apache
|
||||||
|
tags:
|
||||||
|
- nextcloud
|
||||||
|
|
||||||
|
# - name: Generate ssl config
|
||||||
|
# shell:
|
||||||
|
# cmd: "/usr/local/sbin/vhost-domains {{ nextcloud_instance_name }} | /usr/local/sbin/make-csr {{ nextcloud_instance_name }}"
|
||||||
|
# creates: "/etc/nginx/ssl/{{ nextcloud_instance_name }}.conf"
|
44
webapps/nextcloud/templates/apache.conf.j2
Normal file
44
webapps/nextcloud/templates/apache.conf.j2
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName {{ nextcloud_domains | join(' ') }}
|
||||||
|
|
||||||
|
DocumentRoot {{ nextcloud_webroot }}/
|
||||||
|
|
||||||
|
<Directory {{ nextcloud_webroot }}/>
|
||||||
|
Require all granted
|
||||||
|
AllowOverride All
|
||||||
|
Options FollowSymLinks MultiViews
|
||||||
|
|
||||||
|
<IfModule mod_dav.c>
|
||||||
|
Dav off
|
||||||
|
</IfModule>
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
# user - group (thanks to sesse@debian.org)
|
||||||
|
AssignUserID {{ nextcloud_instance_name }} {{ nextcloud_instance_name }}
|
||||||
|
|
||||||
|
# LOG
|
||||||
|
CustomLog /var/log/apache2/access.log vhost_combined
|
||||||
|
CustomLog /home/{{ nextcloud_instance_name }}/log/access.log combined
|
||||||
|
ErrorLog /home/{{ nextcloud_instance_name }}/log/error.log
|
||||||
|
|
||||||
|
# REWRITE
|
||||||
|
UseCanonicalName On
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{HTTP_HOST} !^{{ nextcloud_domains | join(' ') }}$
|
||||||
|
RewriteRule ^/(.*) http://%{SERVER_NAME}/$1 [L,R]
|
||||||
|
|
||||||
|
# PHP
|
||||||
|
#php_admin_flag engine off
|
||||||
|
#AddType text/html .html
|
||||||
|
#php_admin_flag display_errors On
|
||||||
|
#php_flag short_open_tag On
|
||||||
|
#php_flag register_globals On
|
||||||
|
#php_admin_value memory_limit 256M
|
||||||
|
#php_admin_value max_execution_time 60
|
||||||
|
#php_admin_value upload_max_filesize 8M
|
||||||
|
#php_admin_flag allow_url_fopen Off
|
||||||
|
#php_value default_charset ISO-8859-15
|
||||||
|
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f {{ nextcloud_instance_name }}"
|
||||||
|
php_admin_value open_basedir "/usr/share/php:/home/{{ nextcloud_instance_name }}:/tmp"
|
||||||
|
|
||||||
|
</VirtualHost>
|
Loading…
Reference in a new issue