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

Experimental tightening up of Moodle on NGINX

This commit is contained in:
root 2021-07-02 11:15:56 -04:00
parent 7381031ceb
commit c9ae808a6f
3 changed files with 29 additions and 22 deletions

View file

@ -1,5 +1,5 @@
# If using Moodle intensively, consider setting nginx_high_php_limits in:
# /etc/iiab/local_vars.yml
# 2021-07-02 WARNING: Stage 4's roles/www_options/tasks/main.yml FORCES
# (the equivalent of) 'nginx_high_php_limits: True' if 'moodle_install: True'
# moodle_install: False
# moodle_enabled: False

View file

@ -5,8 +5,8 @@
# should take advantage of soon, as it transitions from Apache to Moodle: #2785
# 2021-06-28: This ALSO now happens in /etc/php/{{ php_version }}/cli/php.ini
# (as required by Moodle's CLI installer) AND THIRDLY below (for now, until
# Moodle's ported to NGINX!) in /etc/php/{{ php_version }}/apache2/php.ini
# (as required by Moodle's CLI installer, DESPITE it using fpm/php.ini later!)
#- name: "Set 'apache_install: True' and 'apache_enabled: True'"
# set_fact:
@ -17,6 +17,7 @@
# include_role:
# name: httpd
- name: "Set 'postgresql_install: True' and 'postgresql_enabled: True'"
set_fact:
postgresql_install: True
@ -31,8 +32,8 @@
- name: Install libsodium23 + 8 PHP packages (run 'php -m' or 'php -i' to verify)
package:
name:
- php-apcu
- ghostscript
#- php-apcu # 2021-07-02: Experiment with fewer dependencies
- ghostscript # 2021-07-02: OPTIONAL -- but useful for annotation of PDF's / assignments
- libsodium23 # 2021-06-28: Likewise installed in nginx/tasks/install.yml via php{{ php_version }}-fpm AND httpd/tasks/install.yml via libapache2-mod-php{{ php_version }} AND wordpress/tasks/install.yml -- it can ALSO be auto-installed by phpX.Y-cgi OR phpX.Y-cli as confirmed by 'apt rdepends libsodium23' -- Recommended by Moodle 3.11+ at https://docs.moodle.org/311/en/Environment_-_PHP_extension_sodium -- whereas https://www.php.net/manual/en/sodium.installation.php says it's always bundled with PHP 7.2+ -- VERIFY USING 'php -i | grep sodium' AND 'apt list "*sodium*"'
#- php{{ php_version }}-common # 2021-06-27: Auto-installed as an apt dependency. REGARDLESS: php{{ php_version }}-common superset php{{ php_version }}-cli is auto-installed by php{{ php_version }}-fpm in nginx/tasks/install.yml
#- php{{ php_version }}-cli # 2021-06-27: Compare to php{{ php_version }}-common just above! 2020-06-15: In the past this included (below) mbstring? However this is not true on Ubuntu Server 20.04 LTS.
@ -41,12 +42,12 @@
- php{{ php_version }}-intl # 2020-12-03: Required by Moodle 3.10+ -- Likewise installed in mediawiki/tasks/install.yml, nextcloud/tasks/install.yml, wordpress/tasks/install.yml
- php{{ php_version }}-mbstring # 2020-06-15: Required by Moodle 3.9+ -- Likewise installed in mediawiki/tasks/install.yml, nextcloud/tasks/install.yml, pbx/tasks/freepbx_dependencies.yml, wordpress/tasks/install.yml
- php{{ php_version }}-pgsql # 2021-06-27: Required for PostgreSQL
- php{{ php_version }}-json
- php{{ php_version }}-opcache
- php{{ php_version }}-readline
#- php{{ php_version }}-json # 2021-07-02: Not requested by Moodle's PHP doc above. Package baked into PHP 8+. FWIW with PHP < 8, phpX.Y-json is already auto-installed by phpX.Y-fpm in 3-base-server's nginx/tasks/install.yml
#- php{{ php_version }}-opcache # 2021-07-02: Experiment with fewer dependencies
#- php{{ php_version }}-readline # 2021-07-02: Experiment with fewer dependencies
- php{{ php_version }}-soap # 2020-12-03: Recommended by Moodle 3.10+
- php{{ php_version }}-xml # 2021-06-28: Likewise installed in mediawiki/tasks/install.yml, nextcloud/tasks/install.yml, pbx/tasks/freepbx_dependencies.yml, wordpress/tasks/install.yml -- AND REGARDLESS dragged in later by Admin Console's use of php-pear for roles/cmdsrv/tasks/main.yml -- run 'php -m | grep -i xml' which in the end shows {libxml, SimpleXML, xml, xmlreader, xmlwriter}
- php{{ php_version }}-xmlrpc # 2021-06-27: Required per https://docs.moodle.org/19/en/PHP_settings_by_Moodle_version#PHP_Extensions_and_libraries BUT UNMAINTAINED FOR YEARS (POSSIBLE SECURITY RISK) SO MOVED TO PECL: https://php.watch/versions/8.0/xmlrpc
#- php{{ php_version }}-xmlrpc # 2021-07-02: Doesn't exist with PHP 8.0 -- officially required per https://docs.moodle.org/19/en/PHP_settings_by_Moodle_version#PHP_Extensions_and_libraries BUT UNMAINTAINED FOR YEARS (POSSIBLE SECURITY RISK) SO MOVED TO PECL: https://php.watch/versions/8.0/xmlrpc
- php{{ php_version }}-zip # 2021-06-27: Likewise installed in nextcloud/tasks/install.yml, pbx/tasks/freepbx_dependencies.yml, wordpress/tasks/install.yml
state: present

View file

@ -1,21 +1,27 @@
location ~ ^/moodle/dataroot/ {
internal;
alias {{ moodle_data }};
}
#location ~ ^/moodle/dataroot/ {
# internal;
# alias {{ moodle_data }};
#}
location ~ ^/moodle(.*)\.php(.*)$ {
alias {{ moodle_base }}$1.php$2;
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_read_timeout 300;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param PHP_VALUE "max_execution_time=300\n upload_max_filesize=500M\n post_max_size=500M\n max_input_vars=5000";
fastcgi_pass php;
#include fastcgi.conf;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
#fastcgi_read_timeout 300;
# Uncomment to override /etc/php/<VERSION>/fpm/php.ini (AND .../cli/php.ini)
#fastcgi_param PHP_VALUE "max_execution_time=300\n upload_max_filesize=500M\n post_max_size=500M\n max_input_vars=5000";
}
location ~ ^/moodle/ {
location ~ ^/moodle {
root {{ iiab_base }};
}