How Do I Host This Site?

How is this site hosted?

The short answer: Amazon Web Services. The long answer: the rest of this post.

Here, you can see that my EC2 instance is currently up and running. So, why did I choose the cloud, and why did I choose AWS?

Firstly, using the cloud has many benefits: rapid elasticity, scalability, pay-as-you-go costs, and high availability. All of these are very handy for me, and it removes all of the headache involved with hosting it in your own home (power, cooling, networking, etc.).

So then, why AWS? Would I recommend it to others? Yes, I absolutely would, especially if you’re in the same situation as me where you keep costs low. There’s one reason and one reason alone why I decided to use AWS – their free tier is excellent and includes 720 hours per month of EC2 usage, for 12 months. This essentially means that I can host my website free of charge using AWS for an entire year… and in a year’s time I can either decide to migrate my website to another cloud provider, host it on-premises, or just stick with AWS and pay monthly.


Now, I’ll show you the steps I took in order to get my website up and running. Creating your own website isn’t too tricky, but unless you want to keep the URL provided to you by AWS (hint: you don’t) you will also require a domain and a DNS record provider.

In the above image, you can see that I’ve been provided with the zenfulmonkey.com domain by Squarespace. Yes, it does expire in a year’s time, and no, you can’t steal it from me – it automatically renews itself.

If you’d like to follow in my footsteps (which I’d recommend, as a domain allows you to do more than just host a website) then buying your own domain is easy and not too expensive either, as long as you don’t go for anything too fancy.

This is Cloudflare. Cloudflare can do many things – for this website it provides DNS record management, SSL certificates, security features, and more. There is a free tier – so there’s no excuse not to use it.


Now let’s dig into how I actually went about getting this website up and running.

Firstly, I signed up for an Amazon Web Services account. There’s plenty of documentation on the AWS website to help you get started with using their services and there’s also training that they offer, so I won’t be going into too many details with this part of the setup.

In the above picture, I’ve navigated to the EC2 (Elastic Compute) panel and began creating a virtual machine. I decided to use an Amazon Linux image – both because it was eligible to use within the free tier offering and because it was something new to me.

Next, I’ve configured the networking settings. I’ve allowed SSH (secure shell) traffic from my own IP address, as this will enable to connect to the virtual machine and do the initial configuration for it. I’ve also allowed HTTP/HTTPS traffic from anywhere on the internet, and this is to allow people to actually visit the website.

Then, I’ve done a few things:

  • Downloaded the SSH configuration file,
  • Used Windows Terminal to connect to the virtual machine as the root user,
  • Been told off by the operating system for logging in as root,
  • Used SSH a second time to log in as the EC2 user account.

Here, I’ve utilised what little Linux knowledge I have to update any packages that require updates then I’ve installed the packages necessary to run a web server.

It works! Well, it does the bare minimum. At its current stage, my server can process HTTP requests and display those two encouraging words. Now all we need is an SSL certificate and a proper hostname in order to look cool, and an actual website. I don’t know the first thing about coding or web design, so to make it easier I’m going to use WordPress.

They say a picture is worth a thousand words – these three screenshots of the installation process don’t quite do justice to the effort that I put into trying to make WordPress work. It took me a long time.

But, I persevered, WordPress called me ‘sunshine’, and everything was looking good.


I ran through the initial installation of WordPress, which is pretty straightforward so I won’t cover it here, then decided I’d had enough of WordPress for the day. Therefore, next I’ll cover how I setup resolving the hostname of zenfulmonkey.com via Cloudflare DNS and getting an SSL certificate for the site.

Thankfully, it was rather easy to setup the correct records and didn’t take long at all. The ‘A’ type record is responsible for resolving the hostname of ‘zenfulmonkey.com’ to the IP address of the virtual machine running the website. The ‘CNAME’ (canonical name) record ensures that the alias of ‘www.zenfulmonkey.com’ takes people to ‘zenfulmonkey.com’ (which in turn uses the ‘A’ record to take them to my web server). Finally, the ‘HTTPS’ record, well, you can guess what this does.

The SSL certificate was another easy one. As you can see in the image above, you simply pick one of the options and Cloudflare handles the hassle of actually creating and managing certificates.

Finally, we’re done. You can now bask in the glory of the very first look that this website had, thanks to the default template provided by WordPress and the broken images thanks to myself. Hopefully now that I’ve put some work into it, the site does look better in its current state.


Comments

Leave a Reply

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

ZenfulMonkey