Installing Multiple WordPress sites on one Amazon ec2 instance

Today I terminated my old bitnami ec2 instance that hosted my original wordpress site and instead setup a new ec2 instance which is running three wordpress sites. As usual, it took some time, as it’s never always simple, is it?

To get this working, I followed the guides available here:

What needed Changing from the original guide

The guide doesn’t really show how to create the database schema or the user. I followed the instructions here, but they could be expanded a little better.

The instructions set the user to ec2-user when it should be apache, this stops the themes and plugins from working.

sudo chown -R apache:apache /var/www/html/

The instructions install an old (and slower) version of php. Here’s how to install php 7.1:

sudo yum install -y php71-devel php71-mysqlnd php71-pdo php71-mbstring
sudo yum install -y php71-opcache
sudo yum install -y php71-pecl-memcached

More information:

Vhost Configuration and Advanced DNS

In the vhost configuration we need to add the ServerAlias, for example:


In the Advanced DNS section of your name provider, you need two A Record entries. You do not need a CNAME record. The first A Record is @ and points to the IP address of your ec2 instance. The second A Record is www and also points to the IP address.


Also, it’s better for the website to be in /var/www/html and not vhosts folder, as the instructions deviate at one stage from its own advice…

Leave a Reply

Your email address will not be published. Required fields are marked *