Skip to content

Commit

Permalink
Merge pull request #17 from aws-samples/fix_web_yaml
Browse files Browse the repository at this point in the history
Fix web yaml
  • Loading branch information
jtrollin authored Apr 21, 2020
2 parents 839be67 + 9cf676b commit 16e6697
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ If you just want to deploy the Moodle stack follow these steps. You can read the

1) If you plan to use TLS, you must create or import your certificate into Amazon Certificate Manager before launching Moodle.
2) Deploy the 00-master.yaml stack. **Do not enable session caching in ElastiCache and leave both the Min and Max Auto Scaling Group (ASG) size set to one.** The installation wizard will not complete if you have session caching configured.
3) After the stack deployment completes, navigate to the web site to complete the Moodle installation. *NOTE: You may encounter a 504 Gateway Timeout or CloudFront error on the final step of the installation wizard (after setting admin password). You can simply refresh the page to complete the installation.*
3) After the stack deployment completes, navigate to the web site to complete the Moodle installation. *NOTE: You may encounter a 504 Gateway Timeout or CloudFront error on the final step of the installation wizard (after setting admin password). You can simply refresh the page to complete the installation.* You may also see "Installation must be finished from the original IP address, sorry." to solve this you will need to update your database and set the lastip field of the mdl_user table to the internal ip address of your ALB (you can find this by looking at the Network Interfaces from the EC2 page in the AWS Console). From the webserver you can run:
psql -h <hostname> -U<Username>
update mdl_user set lastip='<ip address>';
4) Configure Application caching in Moodle Site Configuration (see below for details).
5) Now you can update the stack that you just deployed to enable session caching and set the Min and Max Auto Scaling Group size values as desired.

Expand Down
8 changes: 4 additions & 4 deletions templates/04-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ Resources:
/tmp/create_site_conf.sh:
content: !Sub |
#!/bin/bash -xe
amazon-linux-extras install -y php7.4 postgresql9.6
amazon-linux-extras install -y php7.3 postgresql9.6
yum install -y awslogs httpd php-pgsql php-gd php-soap php-intl php-mbstring php-xmlrpc php-zip
sed -i 's/memory_limit =.*/memory_limit = 2048M/' /etc/php.ini
if [ ! -f /etc/httpd/conf.d/moodle.conf ]; then
Expand Down Expand Up @@ -651,13 +651,13 @@ Resources:
sudo yum install -y php-pecl-memcached
sudo yum remove -y php-pecl-memcached

wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-7.0/latest-64bit
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-7.3/latest-64bit
tar -xf '/tmp/latest-64bit'
cp '/tmp/artifact/amazon-elasticache-cluster-client.so' /usr/lib64/php/modules/
cp '/tmp/amazon-elasticache-cluster-client.so' /usr/lib64/php/modules/
if [ ! -f /etc/php.d/50-memcached.ini ]; then
touch /etc/php.d/50-memcached.ini
fi
echo 'extension=/usr/lib64/php/7.1/modules/amazon-elasticache-cluster-client.so;' >> /etc/php.d/50-memcached.ini
echo 'extension=/usr/lib64/php/modules/amazon-elasticache-cluster-client.so;' >> /etc/php.d/50-memcached.ini
echo 'extension=igbinary.so;' >> /etc/php.d/50-memcached.ini

#update Moodle source to use DYNAMIC_CLIENT_MODE so Moodle can detect changes to the elasticache cluster membership
Expand Down

0 comments on commit 16e6697

Please sign in to comment.