You are currently viewing How to host a WordPress website in AWS EC2 instance – Part 3

How to host a WordPress website in AWS EC2 instance – Part 3

How to host a WordPress website in AWS EC2 instance – Part 3

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

This will be a 3-part series where in part 1 we have created an EC2 instance in AWS cloud to host our WordPress website, in the part 2 we have installed and configured our WordPress website and in part 3 will complete the setup by enabling DNS and TSL/SSL for our WordPress website.

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance:

Prerequisites:

Step 1: Configure DNS to route traffic to your WordPress instance using domain name.

So far, we were using the Elastic IP address to browser to our WordPress website. But once your website is live, the target audience for your website will use the domain name and not IP address to navigate to your website.

We need to create an “A” record in our DNS management service provided by our domain registrar to create this record. In this demo we are using AWS Route53 as our domain registrar hence we will create the DNS record in AWS Route53 console. But the process will be same for any other domain registrar like GoDaddy.

We will also create a CNAME record (www.techaffaire.com) against our domain name (techaffaire.com) so that if someone tries to access our website using https://www.techaffaire.com the traffic will automatically get redirected to https://techaffaire.com

Login to AWS management console and navigate to Route53 service.

https://aws.amazon.com/

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance

Select the hosted zone for your registered domain name and click “Create record”.

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance

Select “A” as record type and provide the Elastic IP address of your WordPress instance. Click “Create records” to create the record.

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance

Similarly create a second record of type “CNAME” with name as “www” and value as “<your_domain_name>.

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance

Now if we try to access our WordPress website, it can be accessed using the domain name.

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance

Note: It may take some time for the DNS record to get propagated around the world. Hence if DNS resolution does not work for the first time, give it some time and retry.

Next, we need to install TSL/SSL for our WordPress website.

Step 2: Install TSL/SSL for WordPress website in AWS EC2 instance.

Now if you refresh your website in your browser, you will see HTTPS is enabled for your WordPress website hosted on AWS EC2 instance.

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance

Lastly update the URL in your WordPress configuration.

How to install TSL/SSL (HTTPS) for WordPress on AWS EC2 instance

Hope you have enjoyed this 3rd Part and now you are ready to create an awesome website in AWS cloud 😊

Leave a Reply