Skip to content

Commit

Permalink
Merge pull request #2 from ItalyPaleAle/redis-sessions
Browse files Browse the repository at this point in the history
Store PHP sessions in Redis
  • Loading branch information
ItalyPaleAle committed Feb 15, 2019
2 parents 60595f2 + 7ed905b commit 9b5c81b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions nested/vmsetupparams.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"lampProfile": {
"storageAccountName": "[parameters('lampCommon').storageAccountName]",
"storageAccountKey": "[parameters('storageAccountKey')]",
"redisDeploySwitch": "[parameters('lampCommon').redisDeploySwitch]",
"redisDns": "[parameters('lampCommon').redisDns]",
"redisKey": "[parameters('redisKey')]",
"syslogServer": "[parameters('lampCommon').ctlrVmName]",
Expand Down
1 change: 1 addition & 0 deletions scripts/helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function get_setup_params_from_configs_json
export dbadminpass=$(echo $json | jq -r .dbServerProfile.adminPassword)
export storageAccountName=$(echo $json | jq -r .lampProfile.storageAccountName)
export storageAccountKey=$(echo $json | jq -r .lampProfile.storageAccountKey)
export redisDeploySwitch=$(echo $json | jq -r .lampProfile.redisDeploySwitch)
export redisDns=$(echo $json | jq -r .lampProfile.redisDns)
export redisAuth=$(echo $json | jq -r .lampProfile.redisKey)
export dbServerType=$(echo $json | jq -r .dbServerProfile.type)
Expand Down
1 change: 1 addition & 0 deletions scripts/setup_controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ set -ex
echo $dbadminpass >> /tmp/vars.txt
echo $storageAccountName >> /tmp/vars.txt
echo $storageAccountKey >> /tmp/vars.txt
echo $redisDeploySwitch >> /tmp/vars.txt
echo $redisDns >> /tmp/vars.txt
echo $redisAuth >> /tmp/vars.txt
echo $dbServerType >> /tmp/vars.txt
Expand Down
30 changes: 19 additions & 11 deletions scripts/setup_webserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,21 @@ lamp_on_azure_configs_json_path=${1}

get_setup_params_from_configs_json $lamp_on_azure_configs_json_path || exit 99

echo $glusterNode >> /tmp/vars.txt
echo $glusterVolume >> /tmp/vars.txt
echo $siteFQDN >> /tmp/vars.txt
echo $httpsTermination >> /tmp/vars.txt
echo $syslogServer >> /tmp/vars.txt
echo $dbServerType >> /tmp/vars.txt
echo $fileServerType >> /tmp/vars.txt
echo $storageAccountName >> /tmp/vars.txt
echo $storageAccountKey >> /tmp/vars.txt
echo $nfsVmName >> /tmp/vars.txt
echo $nfsByoIpExportPath >> /tmp/vars.txt
echo $glusterNode >> /tmp/vars.txt
echo $glusterVolume >> /tmp/vars.txt
echo $siteFQDN >> /tmp/vars.txt
echo $httpsTermination >> /tmp/vars.txt
echo $syslogServer >> /tmp/vars.txt
echo $dbServerType >> /tmp/vars.txt
echo $fileServerType >> /tmp/vars.txt
echo $storageAccountName >> /tmp/vars.txt
echo $storageAccountKey >> /tmp/vars.txt
echo $nfsVmName >> /tmp/vars.txt
echo $nfsByoIpExportPath >> /tmp/vars.txt
echo $htmlLocalCopySwitch >> /tmp/vars.txt
echo $redisDeploySwitch >> /tmp/vars.txt
echo $redisDns >> /tmp/vars.txt
echo $redisAuth >> /tmp/vars.txt

check_fileServerType_param $fileServerType

Expand Down Expand Up @@ -180,6 +183,11 @@ EOF
sed -i "s/;opcache.enable.*/opcache.enable = 1/" $PhpIni
sed -i "s/;opcache.memory_consumption.*/opcache.memory_consumption = 256/" $PhpIni
sed -i "s/;opcache.max_accelerated_files.*/opcache.max_accelerated_files = 8000/" $PhpIni
# Redis for sessions
if [ "$redisDeploySwitch" = "true" ]; then
sed -i "s/session.save_handler.*/session.save_handler = redis/" $PhpIni
sed -i "s/;session.save_path.*/session.save_path = \"tcp:\/\/$redisDns:6379?auth=$redisAuth\"/" $PhpIni
fi

# Remove the default nginx site
rm -f /etc/nginx/sites-enabled/default
Expand Down

0 comments on commit 9b5c81b

Please sign in to comment.