Home » Amazon Web Services

Tag: Amazon Web Services

Migrating an Existing WordPress Site to AWS Lightsail

Introduction

In this guide we will walk through the steps to to migrate an existing wordpress website to a new AWS Lightsail instance.

Create a New Lightsail Instance

Description Screenshot
Log into the AWS management console
Click Create Instance
Choose the AWS Region, Platform, and Blueprint

As this is a wordpress example we have chosen

London, Linux and an Apps+OS using WordPress

If necessary generate a new SSH key pair and be sure to download the private key PEM file.
Choose your Instance plan
Give your instance a name
Click Create Instance

Setup your Lightsail Instance – Networking

Description Screenshot
In Light sail > Instances > Left click your instance
Here you can connect to the instance via SSH

Click Connect using SSH

If you are keeping this instance then you should generate a Static IP Address for this instance so things like DNS can point to the server.

Click Networking > Create Static IP

Select the Instance to attach this static IP Address to and give your static ip a name
Click Create
Instantly the IP address will be added to the lightsail instance. If you had any ssh sessions opened previously you will need to reconnect

Note that you can have up to 5 static ip addresses for your account and they are free only if attached to running instances.

Setup your Lightsail Instance – Operating System

Description Screenshot
In the Lightsail console home

Click you instance

Click connect using SSH

In the console type to obtain the password of the wordpress ‘user’ account generated by bitnami cat bitnami_application_password

Copy the password locally and keep it safe for later use

Currently bitnami wordpress is limited to 40MB Uploads. You can edit the php.ini file and increase this as per this Bitnami Support doc

Browse to /opt/bitnami/php/etc/php.ini

STEP1:

In php.ini find

And change it to:

STEP2

In php.ini find

And change it to:

; Maximum size of POST data that PHP will accept.

post_max_size = 512M

; Maximum allowed size for uploaded files.

upload_max_filesize = 512M

Restart Apache

Command:

sudo /opt/bitnami/ctlscript.sh restart

Optional

Update the WP All in one Plugin to work correctly upload files.

Known Error: Uploading a .wpress file from the local device would

In the console browse to

‘cd /opt/bitnami/wordpress/wp-content/plugins’

Command:

‘wget https://import.wp-migration.com/all-in-one-wp-migration-file-extension.zip’

Unzip the file Command:

‘unzip all-in-one-wp-migration-file-extension.zip’

Log out of the console

 

Setup your Lightsail Instance – WordPress Settings

Description Screenshot
User your internet browser to connect to the static IP address of your instance

 

http://<yourstaticIPaddress>/wp-admin

User: user

Password: whatever you obtained from the previous step bitnami_application_password file in the console

Perform all wordpress updates – if available
Perform all plugin updates – if available
Update all themes – if available
Active the Wp All In One Migration Plugins
Click the Migration Import option in the left sidebar
Note the upload maximum is 512M (and not 40M)
Upload your .wpress file from a saved copy from your existing wordpress instance

(If you dont have one you can install the same Wp Migration plugin into your existing wordpress instance and ‘export’ it first so you can then import it to this new instance)

Warming: You must ALSO know the existing wordpress instances username and password as these will be overwritten when the import completes.

Click Proceed if happy to continue

Once complete be sure to click the ‘save permalinks structure’ and then click finish
Update your permalinks to your preferred format for your blog posts Choose the format, then click save

Site import complete

Final Steps

Description Screenshot
You should update the lightsail instance(s) with

sudo apt-get update

You should update any additionally imported wordpress themes or plugins and test the website is functioning perfectly.

Especially things like contact us forms, reauthorising plugins (and moving stats for jetpack to this new site)

You may need to import other things like ads.txt file or SSL certificates.

See this article on how to create and import an SSL Cert into your Lightsail instance.

You should go back to the Lightsail console and take snapshots of your instance(s)

Click Create Snapshot

You Should also enable automatic snapshots, where lightsail will store 7 consecutive snapshots of your Lightsail instance, taken every 24 hours at the same time.

 

You should change your DNS settings to newly point to the static IP address of your new lightsail instance BEFORE you terminate your old website.

DNS time to live settings can be long so sometimes people may have cached the DNS record for your website with the old ip address for hours or even days.

 

 

 

 

 

How to configure an AWS IoT Button

Cloud Video Walk Through – AWS IoT Button

In this video series mastersof.cloud walks through the steps of creating your own ‘personal alarm’ button and details how to configure an AWS IoT Button, join it to your wireless network, connect it to an amazon account, assign it to trigger a Lambda function which finally sends a notification to SNS (SMS message in this example).

 

Important Points to note

  1. Take note of your region when you register your button as not all SNS features are available in all regions (SMS capability is not available in AWS SNS in London eu-west-2 for example)
  2. This configuration differs to the AWS IoT 1-Click system so be sure you have a ‘blue’ AWS IoT Button and not something else.
  3. The button can only use a 2.4g wifi network
  4. there are reports of the buttons having a relatively limited lifetime (~2000 clicks, 90 days) so maybe best to program this for something that doesnt need to be clicked every 2 minutes 🙂

They have more videos here on their youtube channel

Enjoy!

AWS IAM CERTIFICATE_VERIFY_FAILED

Situation

When attempting to call AWS CLI commands we were receiving a CERTIFICATE_VERIFY_FAILED error message. We were using a proxy service. In this specific instance we were connecting to AWS IAM via zScaler Internet Access (ZIA)

Example

we were running a simple

aws iam get-role --role-name vmimport

 

Workaround

include–no-verifyssl to by pass the ssl verification

aws iam get-role --role-name vmimport --no-verify-ssl

Solution

Drop or whitelist the iam.amazonaws.com from SSL inspection on the proxy server

Brief Comparison of AWS and Azure – IaaS

Introduction

This article was created as a very quick reference between the Amazon’s AWS EC2 and Microsoft’s Azure. There was little in the way of scientific tests carried out, it is purely a list of observations during the testing so these results below are personal opinion / experience only. You should carry out your own scientific testing and ensure that your design and chosen platform meet all the requirements for your business need!

Summary

I find that I typically read these articles like this for the summary only and then read the ‘explanation’ (if I can be bothered!) so with that in mind here is the summary / findings below first, then it is up to you if the rest is worth it!

I personally believe that Azure offers a more simple, friendly (almost familiar) interface to quickly spin up and use cloud based VM’s, however even though the AWS solution seemed more complicated initially, from the initial investigations it has a few more options for flexibility (firewall rules, Private networking etc, VM Images etc.

Regardless of the console used or how the VM’s are deployed it ultimately comes down to VM performance. On both platforms the VMs operated as if they were local and were as quick as each other. In fact most applications opened quicker than locally (I.E Office etc) everything was snappy and ‘near instant’,

Choosing the VM / cloud / IaaS solution is easy so how about integrating it with your existing network? The users data? The users files? The business applications? The users home drive? Personalised settings, favourites? Email etc… This is where the most of the effort, expense and time must be spent so the cloud transition happens automatically and seamlessly for the users and is a winning solution overall.

If I had to personally spend my money and was looking at this for a hybrid cloud solution, server replacement or possibly even DaaS with a very simple setup and easy console I would choose the Azure platform, particularly because of the other offerings around Office 365, One drive, and remoteapps over RDP (Seamless published apps)

Amazon Web Services – AWS EC2

After registration (and providing credit card details and verifying a valid answerable phone number) and logging in you first notice that console is busy and confusing.

As part of the 12 months trial we are offered Windows 2012 R2 server. Plenty of other options to configure like Virtual private networking etc – but I just wanted the quickest VM setup in the shortest amount of time.

Login security of the VM (once provisioned) required a few more steps as you need to create key pairs (pem certificate) then use that pem file to decrypt the password of the VM once its provisioned, however connection to the VM was as simple as downloading an RDP file. There were quite a few other options that would be confusing for ‘non I.T’ savvy users (firewall rules, RDP ports etc)

The instance provisioning and login was quicker than Azure by a couple of minutes. ICMP was allowed with pings out to 4.4.4.4 (google DNS server) at around 6ms from the selected availability zone (AZ). (us-west-2 – only US was selectable during provisioning)

Moving VMs between the availability zones the VM needs to be shutdown and an AMI (Amazon Image) created and then a new VM deployed from another availability zone on that image.

Internet speeds were ridiculously quick but varied greatly depending on the time the tests were run. The trial wasn’t restricted in anyway and on the machine you can literally do whatever you want out of the box. The AWS VM was registered and activated online without any errors or faults.

The configuration of AWS seems more flexible with a myriad of other IT Admin options provided if not initially more complicated and confusing. The VM setup and deployment worked without any error, glitch, or problem and the performance of the VM was snappy responsive and as an end user would come to expect from a local desktop or server.

Microsoft Azure

The console and the configuration of the Windows trial VM, was quite a simple experience.

Login with Microsoft LIVE credentials; provide credit card details, provision instance of VM. The provision to actual login time was slower than that of AWS by around 2 minutes. Connection to the VM was immediate and as simple a downloading an RDP file and providing the original credentials I set during provisioning.

Weirdly during testing of the VM Google ads and the Google site continued to default to Japanese though the server locale was set to US and the Availability Zone was West Europe? Doing a lookup on the external IP address came up as a US based IP address so this was left unexplained.

ICMP out from the VM was blocked so was unable to perform a simple ping latency test. There are quite a few discussions online around this and it seems that it snot yet possible to open it (AWS was more flexible form this point of view)

The Azure management console (manage.windowsazure.com) is far cleaner and simpler to find the right ‘buttons and tools’ than that of the AWS though there are still a number of options and details to get your head around. The entire design of the console feels more like a Windows 8 type page.

Moving VMs between the availability zones doesn’t seem to be as simple as right click ‘move’ however there is a great article here on how to do it.

There is a management portal (portal.azure.com) which seems to be Microsoft’s single pane of glass approach to Azure and it is fantastic, intuitive, simple, and has everything you want to know about your cloud based estate available in a typical Windows 8 ‘tile’ style.

The Windows VM was super quick and snappy, but, rather ironically, during testing Windows reported that it wasn’t activated, nor could it be activated (possibly due to the trial?)

The site is transparent and upfront about its charges and costs the majority of which can be found under the billing section of the portal.

Via my MacBook RDP client there was also integration and configuration for Azure RemoteApps (aka Office 2013 published seamlessly over RDP) though the initial setup of remote app took well over 25 minutes, and launching of the apps was actually slow and rather tedious so more investigation and time required to review this one appropriately.

The Availability Zones at the time of writing are:

Aside from the small annoyances with the configuration of the VM, the console and portal for management of the Azure stack is fantastic and the performance of the VM was snappy, responsive and as an end user would come to expect from a local desktop or server.

Comparison Table

Comparison Table AZURE AWS
Desc Details Details Notes
Setup time for subscription to begin 02:30 01:00  Account Provision time
Timing VM Deployment to login Deploy Deploy Connect icon available after start – but obviously server not yet ready
01:20 VM start 00:52 – Running
03:30 running (provisioning) 02:41 – Password ready
07:00 – Logon to desktop 03:30 Logon to desktop
09:50 – Finished 04:01 Finished
Responsiveness of desktop 9/10 9/10  Both equally as good – rated purely on personal feel
Internet connectivity speed See Below Table for connectivity See Below Table for connectivity  Results varied greatly
Availability zones West Europe  US-West-2
Store / Console ease of use 9/10 7/10 The Azure Console is fantastic, sleek and similar to Windows 8 Look and feel.
The AWS Console looks a little dated, and is confusing with so many options in your face.
Trial Offers 30 Days 12 Months
Ease of connectivity to VM Easy – Direct RDP Easy – Direct RDP
Youtube over RDP! 6/10 6/10 Surprisingly quick on both servers, if not majorly compressed and a bit laggy.

Internet Speed Tests

Internet Speed tests AWS     AZURE  
Ping Down (Mbps) Up (Mbps) Ping Down (Mbps) Up (Mbps)
speedtest.org 1 4.6 35.71 40.07 53.52
speedtest.org 2 9.74 20.83 41.87 56.42
speedtest.org 3 4.18 26.32 38.81 37.25
Ave 6.173333333 27.62 Ave 40.25 49.063333
speedtest.net 1 26 712.62 280.79 151 3.75 1.29
speedtest.net 2 17 701.18 949.91 146 6.61 9.82
speedtest.net 3 18 693.65 950.95 148 194.64 27.16
Ave 702.4833333 727.21667 Ave 68.33333333 12.756667

 

Tested VM Configuations

Tested Configurations  Azure AWS 
OS Windows Datacenter 2012 R2 Windows Datacenter 2012 R2
CPU 2 1
RAM 1.75 1
Disk configs C drive of 110gb C Drive of 30GB Azure temp drive blurb
Advertised Internet connectivity No Limit Low to Moderate
Data persistent YES YES Folder exists and remains across reboots.
Pricing HERE HERE
Other Services / Images / VMs Huge list of preconfigured VMs, Images and templates Huge list of preconfigured VMs, Images and templates
Simple Integration with other Vendor Services YES – easy plug into one drive, Office 2013 Remote app, Office 365
Approx costs PH in $USD $0.09 USD A1 Windows Tier $0.018 USD Windows T2 micro The Windows Pricing seems much simpler and easier, though AWS have far more granulatiry and control*These are the machines that were offered as part of the free trial. They were not selected as an exact like for like.