Last updated on May 4th, 2020 at 04:00 pm
This is the second part of the tutorial – How to setup free WordPress hosting on AWS EC2 instance.
In the Last tutorial, we were able to host free WordPress on new EC2 instance also, we were able to successfully mapped it to a domain name using GoDaddy DNS Manager.
Today, we will continue to add some free features provided by AWS to make our blog more professional.
- We will map a static IP address with our ec2 instance to prevent changing it at every reboot.
- Then, we will remove Bitnami Logo from bottom right corner of our blog.
- And then, we will see how we can make our site secure by using Letsencrypt
Check this complete step by step video tutorial:
Associating Elastic IP with ec2 Instance
Our last AWS installation had some issues. The first problem was that if the EC2 instance got shutdown, then the IP address associated with the EC2 instance would also detach from it. Now, this is a real issue because our domain name is mapped to EC2 instance via IP address only. Therefore, our domain name would fail to find the WordPress location.
To deal with this particular problem, we are going to use Elastic IP. Elastic IP is a static IP that you can assign to any ec2 instance so that its IP address do not change on reboot or shutdown. It is a free AWS service and we can attach the Elastic IP to any instance ID. This way we can even change EC2 instance completely without changing Domain name to IP address mapping. Cool!
To create an Elastic IP address:
First go to EC2 Console.
Then from left menu, click Elastic IP.
Now, click Allocate Elastic IP Address button.
You should see image like this. Click Associate.
After that, you will be allocated new Elastic IP. Now, we need to associate it with our EC2 instance.
Click on the newly created IP address and then, click Associate Elastic IP Address button.
Select your EC2 instance from Choose an Instance search bar and click Associate button.
And now, your Elastic IP is associated with an EC2 instance with a static IP that does not change over a reboot. Just update new static IP in GoDaddy DNS entry and you should be able to see your website without any problem.
Remove Bitnami logo from blog home page
Till now, there is an ugly Bitnami logo attached to our site and we simply need to remove it. To remove it, we will need to login to our EC2 instance. If you remember from the last post, we downloaded a .pem file from Create EC2 instance wizard. This file is very important and you need to keep it somewhere safe because without this file, you will not be able to login to ec2 instance.
To login into EC2 instance, type following the commands in terminal
sudo chmod 400 YOUR_EC2_KEYNAME.pem
Once you logged in, type
sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1
This should disable the Bitnami banner from you blog.
Enable SSL for WordPress
SSL, Secure Sockets Layer, is a communication protocol that provides security when the data is in transit. When a user submits a comment on your blog and when you try to login to the administration area, your login credentials travels over the network in plain text. To mitigate this problem, it is highly recommended to enable SSL on your site. So that, your message gets encrypted at client’s end and only server is able to decrypt it.
To enable SSL, we will use the inbuilt Bitnami tool, which will do all the heavy lifting for you. Type the following on terminal:
It will ask for domain name. Provide domain name like kumarvinay.com with no http or www prefix and hit enter.
Then, the tool will ask for some additional settings like: redirect http to https (select Yes), redirect non-www to www (select Yes) etc. Just follow along and your site will be upgraded to SSL.
Now your WordPress is ready for the world. Just change the content and enjoy.