1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Move php-fpm / high limits from www_back_end (3) to www_front_end (4)

This commit is contained in:
root 2020-02-16 02:47:45 -05:00
parent aad6d421df
commit 8abc11d54b
3 changed files with 37 additions and 33 deletions

View file

@ -14,7 +14,7 @@
- php-dom
- php-exif # Optional (for image rotation in pictures app)
- php-fileinfo # Optional (enhances file analysis performance)
- php-fpm # Optional (FastCGI Process Manager)
- php-fpm # ALSO INSTALLED IN roles/www_back_end (Stage 3) for nginx_high_php_limits
- php-gd
- php-gmp # Optional (for SFTP storage)
- php-iconv

View file

@ -5,39 +5,8 @@
- include_tasks: html.yml
- include_tasks: php-stem.yml
- name: Install php-fpm (FastCGI Process Manager) if nextcloud_install or pbx_install
package:
name: php-fpm
when: nextcloud_install or pbx_install
# COMPARE apache_allow_sudo @ roles/www_front_end/tasks/main.yml
# For schools that use WordPress/Nextcloud/Moodle intensively.
# WARNING: Enabling this might cause excess use of RAM/disk or other resources!
- name: Enact high limits in /etc/php/{{ php_version }}/fpm/php.ini if using WordPress/Nextcloud/Moodle intensively
lineinfile:
path: "/etc/php/{{ php_version }}/fpm/php.ini"
#path: "/etc/php/{{ php_version }}/{{ apache_service }}/php.ini"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
- { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
- { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is 128M / Nextcloud requests 512M' }
- { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
when: nginx_high_php_limits | bool
- name: Restart 'php{{ php_version }}-fpm' systemd services
systemd:
name: "php{{ php_version }}-fpm"
state: restarted
- name: Create dir {{ doc_root }}/home -- if you customized var iiab_home_url e.g. in /etc/iiab/local_vars.yml, that dir is created later -- by www_front_end/tasks/main.yml
file:
state: directory

View file

@ -25,11 +25,46 @@
when: nginx_install | bool
- block: # 3-STANZA BLOCK BEGINS
# Also installed by roles/nextcloud/tasks/install.yml in case './runrole nextcloud' bypasses this role here. (Possibly make php-fpm mandatory in nginx/tasks/install.yml in future?)
- name: Install php-fpm (FastCGI Process Manager) as nec
package:
name: php-fpm
# For schools that use WordPress/Nextcloud/Moodle intensively.
# WARNING: Enabling this might cause excess use of RAM/disk or other resources!
# COMPARE apache_allow_sudo further below.
- name: Enact high limits in /etc/php/{{ php_version }}/fpm/php.ini if using WordPress/Nextcloud/Moodle intensively, as nec
lineinfile:
path: "/etc/php/{{ php_version }}/fpm/php.ini"
#path: "/etc/php/{{ php_version }}/{{ apache_service }}/php.ini"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^upload_max_filesize', line: 'upload_max_filesize = 500M ; default is 2M' }
- { regexp: '^post_max_size', line: 'post_max_size = 500M ; default is 8M' }
- { regexp: '^memory_limit', line: 'memory_limit = 512M ; default is 128M / Nextcloud requests 512M' }
- { regexp: '^max_execution_time', line: 'max_execution_time = 300 ; default is 30' }
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
when: nginx_high_php_limits
- name: Restart 'php{{ php_version }}-fpm' systemd services, as nec
systemd:
name: "php{{ php_version }}-fpm"
state: restarted
when: (nextcloud_install or pbx_install) and nginx_enabled # 3-STANZA BLOCK ENDS
# 'Is a "Rapid Power Off" button possible for low-electricity environments?'
# gives more details here: http://FAQ.IIAB.IO
# COMPARE nginx_high_php_limits further above.
# 2020-02-12: DOES THE FLAG BELOW (apache_allow_sudo) WORK WITH NGINX TOO ?
# COMPARE nginx_high_php_limits @ roles/www_back_end/tasks/main.yml
- name: Give {{ apache_user }} (per variable apache_user) permission to poweroff, installing /etc/sudoers.d/020_apache_poweroff from template
template: