AWS WordPress 5: Post-Installation

Overview

This post is the fifth of a 5-post series with step-by-step procedures that I followed recently to setup WordPress on AWS for this version of the website. In this post, post-installation configuration improvements are made to the AWS instance to support WordPress.

Increasing Memory Limits for Upload:

Some of the WordPress themes have zip file uploads that exceed the arbitrarily low thresholds (e.g., 2M bytes). To support these more typical scenarios, the memory limits, and a few other limits, will be increased by editing the ‘php.ini’ file.

Use SSH and log back into the AWS EC2 instance. Navigate to the following directory:

cd /etc/php/7.0/apache2

Edit the ‘php.ini’ file:

sudo nano php.ini

Use ctrl-w to search for each of the following parameters and find its location in ‘php.ini’. Increase the values to those shown (or leave unchanged if the default values are larger). Note that these parameters are not co-located, but scattered throughout the file.

memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_vars = 3000

Enter ctrl-x, type y, and return to save.
Restart Apache2:

sudo systemctl restart apache2

Then, exit out of the remote session. Done!

Creating and Resuscitating an Amazon Machine Image (AMI):

Although the process to create an instance, setup keys, install a LAMP stack, and download/configure a WordPress installation is straightforward, it does take time. Add the time to setup and populate a WordPress website, it can take a non-trivial amount of time to repeat in case of a serious operational problem. AWS has the Amazon Machine Image (AMI) feature that with a few clicks can store a byte-by-byte copy of the entire instance. Highlight an instance and select ‘Create Image under Actions -> Image’:

Enter the name and description for the image and click ‘Create Image’.

To restore an image on a new instance within just a few minutes, select ‘AMIs’ from the left column on the EC2 dashboard. Select the image and click ‘Launch’ which will display the steps to create an instance and populate it with the selected AMI.

A few notes:

  • Re-associate an existing Elastic IP to maintain the DNS website name.
  • Always note and save the various usernames and passwords during installation.
  • Always create a new key pair following the instructions earlier in this post.

WordPress Backup:

An essential operational activity of any WordPress website is conducting backups on a regular basis. Website backups are necessary for archival purposes and in the event that I move the website to a new AWS instance. For a WordPress site, both the WordPress database and folders/files need to be included in a backup. I use UpdraftPlus (a WordPress plug-in).

Reference Material:

Ubuntu 16.04 LAMP server tutorial with Apache 2.4, PHP 7, and MariaDB (instead of MySQL)
How to install WordPress 4.5 on Ubuntu 16.04 LAMP
Ubuntu Forums – WordPress and PHP
Install LAMP Stack on Ubuntu 16.04

2017-08-07T13:59:58+00:00 By |Amazon Web Services, Wordpress|2 Comments

2 Comments

  1. Cary August 2, 2017 at 3:18 am - Reply

    Hi Red-Leader,
    This is a great post on setting up a WP instance on AWS.
    Thanks.

    • RedLeader8 August 2, 2017 at 3:26 am - Reply

      Thanks for your feedback, Cary. You are my biggest fan. 🙂

Leave A Comment