From 535928586f24ae2c3ef524822526b6d45fac82d1 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 20 Jul 2023 21:38:29 +0200 Subject: [PATCH 1/2] Improve PHP-FPM + add maintenance:mode Give everyone the improved config if running PHP-FPM Signed-off-by: Daniel Hansson --- nextcloud_update.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index e3a7d671b9..26af48d710 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -330,9 +330,30 @@ then apt-get update -q4 --allow-releaseinfo-change & spinner_loading fi +# Enter maintenance_mode +nextcloud_occ_no_check maintenance_mode --on + # Upgrade OS dependencies export DEBIAN_FRONTEND=noninteractive ; apt-get dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" +# Improve Apache for PHP-FPM +if is_this_installed php"$PHPVER"-fpm +then + if [ -d "$PHP_FPM_DIR" ] + then + systemctl stop apache2 + # Just make sure it's disabled + a2dismod mpm_prefork + a2dismod php"$PHPVER" + # Add some PHP-FPM tweaks + install_if_not libapache2-mod-fcgid + a2enconf php"$PHPVER"-fpm + a2enmod mpm_event + a2enmod proxy_fcgi + restart_webserver + fi +fi + # Fix Realtek on PN51 if asuspn51 then @@ -676,10 +697,12 @@ then chmod +x "$SCRIPTS"/updatenotification.sh fi +# Disable maintenance_mode +nextcloud_occ_no_check maintenance_mode --off + # Update all Nextcloud apps if [ "${CURRENTVERSION%%.*}" -ge "15" ] then - nextcloud_occ maintenance:mode --off # Check for upgrades print_text_in_color "$ICyan" "Trying to automatically update all Nextcloud apps..." UPDATED_APPS="$(nextcloud_occ_no_check app:update --all)" From a0b5b3ae52338cee9ed78b611a06262206875ce5 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 20 Jul 2023 22:47:36 +0200 Subject: [PATCH 2/2] don't use libapache2-mod-fcgid It is the legacy way of running PHP based applications as opposed to the newer PHP-FPM Signed-off-by: Daniel Hansson --- nextcloud_update.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 26af48d710..21e6d00b07 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -341,15 +341,9 @@ if is_this_installed php"$PHPVER"-fpm then if [ -d "$PHP_FPM_DIR" ] then - systemctl stop apache2 - # Just make sure it's disabled + # Just make sure that MPM_EVENT is default a2dismod mpm_prefork - a2dismod php"$PHPVER" - # Add some PHP-FPM tweaks - install_if_not libapache2-mod-fcgid - a2enconf php"$PHPVER"-fpm a2enmod mpm_event - a2enmod proxy_fcgi restart_webserver fi fi