From 077dfa29dadbc185faac43f671aad215a84b46bb Mon Sep 17 00:00:00 2001 From: Adrian Joian Date: Wed, 17 Feb 2021 12:48:37 +0100 Subject: [PATCH 1/2] Adding code to the htmlLocalCopySwitch option Adding code to deal with nfs type backend storage Signed-off-by: Adrian Joian --- scripts/setup_webserver.sh | 58 ++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/scripts/setup_webserver.sh b/scripts/setup_webserver.sh index cb9fa2b6..cdcbf038 100644 --- a/scripts/setup_webserver.sh +++ b/scripts/setup_webserver.sh @@ -281,26 +281,34 @@ EOF # Set up html dir local copy if specified htmlRootDir="/moodle/html/moodle" if [ "$htmlLocalCopySwitch" = "true" ]; then - mkdir -p /var/www/html - ACCOUNT_KEY="$storageAccountKey" - NAME="$storageAccountName" - END=`date -u -d "60 minutes" '+%Y-%m-%dT%H:%M:00Z'` - htmlRootDir="/var/www/html/moodle" - - sas=$(az storage share generate-sas \ - -n moodle \ - --account-key $ACCOUNT_KEY \ - --account-name $NAME \ - --https-only \ - --permissions lr \ - --expiry $END -o tsv) - - export AZCOPY_CONCURRENCY_VALUE='48' - export AZCOPY_BUFFER_GB='4' - - azcopy --log-level ERROR copy "https://$NAME.file.core.windows.net/moodle/html/moodle/*?$sas" $htmlRootDir --recursive - chown www-data:www-data -R $htmlRootDir && sync - setup_html_local_copy_cron_job + if [ "$fileServerType" = "azurefiles" ]; then + mkdir -p /var/www/html + ACCOUNT_KEY="$storageAccountKey" + NAME="$storageAccountName" + END=`date -u -d "60 minutes" '+%Y-%m-%dT%H:%M:00Z'` + htmlRootDir="/var/www/html/moodle" + + sas=$(az storage share generate-sas \ + -n moodle \ + --account-key $ACCOUNT_KEY \ + --account-name $NAME \ + --https-only \ + --permissions lr \ + --expiry $END -o tsv) + + export AZCOPY_CONCURRENCY_VALUE='48' + export AZCOPY_BUFFER_GB='4' + + azcopy --log-level ERROR copy "https://$NAME.file.core.windows.net/moodle/html/moodle/*?$sas" $htmlRootDir --recursive + chown www-data:www-data -R $htmlRootDir && sync + setup_html_local_copy_cron_job + fi + if [ "$fileServerType" = "nfs" -o "$fileServerType" = "nfs-ha" -o "$fileServerType" = "nfs-byo" -o "$fileServerType" = "gluster" ]; then + mkdir -p /var/www/html/moodle + rsync -a /moodle/html/moodle/ $htmlRootDir/ + chown www-data:www-data -R $htmlRootDir && sync + setup_html_local_copy_cron_job + fi fi if [ "$httpsTermination" = "VMSS" ]; then @@ -347,10 +355,6 @@ server { } } -upstream backend { - server unix:/run/php/php${PhpVer}-fpm.sock fail_timeout=1s; - server unix:/run/php/php${PhpVer}-fpm-backup.sock backup; -} EOF fi @@ -403,12 +407,18 @@ EOF fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; fastcgi_pass backend; + fastcgi_param PATH_INFO \$fastcgi_path_info; fastcgi_read_timeout 3600; fastcgi_index index.php; include fastcgi_params; } } +upstream backend { + server unix:/run/php/php${PhpVer}-fpm.sock fail_timeout=1s; + server unix:/run/php/php${PhpVer}-fpm-backup.sock backup; +} + EOF fi From 52596c52d977cb17ea9696f8216175fd5550960a Mon Sep 17 00:00:00 2001 From: Adrian Joian Date: Fri, 19 Feb 2021 10:05:32 +0100 Subject: [PATCH 2/2] Defaulting to Standard Loadbalancer SKU In order to improve overall performance multiple outbound IPs have been added to the ARM templates therefore a switch to the Standard Loadbalancer SKU is required. Signed-off-by: Adrian Joian --- azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azuredeploy.json b/azuredeploy.json index e6dc11a5..99649ba4 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -636,7 +636,7 @@ "type": "string" }, "loadBalancerSku": { - "defaultValue": "Basic", + "defaultValue": "Standard", "allowedValues": [ "Basic", "Standard"