Speeding up WordPress with W3TC and Amazon AWS


This knowledge base article will show you how the steps needed to configure WordPress to use Amazon CDN to speed up the delivery of your WordPress web pages to your visitors.

If at any point you need help please contact us. For Hosting Photography customers we can configure part or all of this for you.


Prerequisites

Amazon AWS

It is assumed that you have an Amazon Web Services (AWS) account. If not you can register for one at https://aws.amazon.com/

WordPress W3TC Plugin

We will also assume that you have the W3TC plugin installed in your WordPress site. This is available at https://wordpress.org/plugins/w3-total-cache/

Configuring Amazon AWS

Create an Amazon User and Assign Permissions

  1. From the AWS Manager click on Identity and Access Management in the Security & Identity Section.
  2. From the Dashboard menu click Users.
  3. Click the Create New User button.
  4. Enter a username and click Create button. Ensure that Generate an Access Key for Each User remains checked.
  5. Your user will successfully be created. We need to record the credentials so expand the section which says Show User Security Credentials.
  6. Make a note of the Access Key ID and Secret Access Key.

Create a New Amazon User

Create a New Amazon User

Enter a Username

Enter Amazon User Name

Note the User Credentials

Record the Amazon User Credentials

Assign CloudFront Policy to User

  1. Click on the User you have just created.
  2. Click the Attach Policy button.
  3. Search for the policy CloudFrontFullAccess and select and click Attach Policy button.

Amazon User

Amazon User

Attach Amazon Policy CloudFrontFullAccess

Attach Amazon Policy
We are now finished in Amazon. We can proceed and create our DNS CNAMEs in cPanel and then configure W3TC within WordPress.


cPanel DNS Configuration


Create CNAMEs within cPanel

  1. Log into your cPanel Control Panel.
  2. Click on Simple Zone Editor under the Domains section.
  3. In the section Add a CNAME enter cd1 as the name, and your Amazon CloudFront Domain Name as the NAME. In our screenshot this would be dkqte338ku838.cloudfront.net
  4. Enter all your CNAMEs with the same CloudFront Domain Name.

Create cPanel CNAMEs

Configure W3TC within WordPress


Configure W3TC within WordPress

  1. Select Performance > General Settings from the WordPress administration menu.
  2. Scroll down to CDN and choose Amazon CloudFront from the options (Origin Pull / Mirror) . Click Save all settings.
  3. Select Performance > CDN from the WordPress administration menu.
  4. Scroll down to Configuration.
  5. Enter your Amazon Access Key ID and Amazon Secret Key (noted from earlier).
  6. Add your sites CNAMEs (cdn1.hostphotography.com, cdn2.hostphotography.com etc…)
  7. Save all Settings.
  8. Return to configuration and click Create Distribution.
  9. Check in Amazon AWS that the distribution has created before enabling CDN in WordPress. It may take 10 minutes or more to create in Amazon AWS. When created the status of the distribution will change from In Progress to Deployed. You can check this from the AWS Manager by selecting CloudFront Distribution in the Storage & Content Delivery section.
  10. Enable Amazon CDN by setting Enable to checked in Performance > CDN configuration.

WordPress W3TC Amazon CDN Configuration

WordPress W3TC Amazon CDN Configuration

Check Amazon CloudFront Distribution

Amazon CloudFront Distribution
Amazon CDN is now delivering parts of your website to visitors.

NodeSpace specialized in hosting for photographers. We fully support hosting WordPress and as part of our managed service we also offer best effort support and configuration of WordPress, from installation to configuration of advanced options like Amazon CDN.

  Print


Comments


  Add Comment

Confirm Submission

Please enter the text from the image in the box provided, this helps us to prevent spam.



Powered by WHMCompleteSolution