I was going through some tests as the certificate for my web page is coming up for renewal and found an error. I’d misconfigured a thing, which would have caused the automated certificate renewal process to fail. Oops. But then it occurred to me that I haven’t yet documented the Roll-Your-Own approach to web hosting that I’ve opted with.
There are a lot of great web hosting platforms out there, and many of them are free (or nearly free). Nothing wrong with those. But I wanted to go back to my roots – when I would build and tinker with servers in my own space. When I decided to start writing, I knew I wanted it to be on my own server.
This quick write-up basically references the important links and sites and services I used to get a server up and running. Many thanks to my good friend Evil Zen Scientist who tipped me to some of the tools used.
Azure
All good servers need to be put somewhere, and I definitely do not have the physical infrastructure (anymore) to build and run a web server 24/7 in my house (nor would I have permission). I opted to go with Azure as the hosting platform. It also aligns with my professional goal of being more intimate and familiar with Azure and its offerings. The resources used are fairly simple.
- Virtual Network – for simply hosting the VM
- Virtual Machine – “the server” – went with the smallest SKU to start
- Public IP – Used to expose the server to the world
- Network Security Group – Provides security, allowing only specific things into the server
- Recovery Services Vault – Used to backup the server
For a simple buildout, I have some bicep that will build the VM.
Post build, I set up Azure to manage the patching which has worked out really well. One of my earlier articles shows this off. Highly recommend!
LAMP
The best web servers run on Linux, and as much as I’m a life-long Windows user, I know the important role Linux has played (and continues to play) in the modern internet. Since I’ve not deployed a LAMP stack in quite a few years, I used a few very excellent guides from Digital Ocean to get Linux, Apache, MySQL and PHP setup on the server.
Initial Server Setup:
https://www.digitalocean.com/community/tutorials/initial-server (Web view)
Deploy the LAMP stack:
https://www.digitalocean.com/community/tutorials/how-to (Web view)
During the configuration of MySQL I ran into an issue that this link helped me solve
https://www.digitalocean.com/community/questions/can-t (Web view)
WordPress
Now, I’ve written some HTML in the past. I’ve used Notepad and Nano to build web sites. But…none of that is really useful in this day and age. In looking around, deploying WordPress seemed the fairly logical choice, and once again Digital Ocean has a fantastic guide on how to install and configure:
https://www.digitalocean.com/community/tutorials/how-to (Web view)
Certificates
Securing a website is a no brainer, but one thing that I’ve seen historically is that certificate management can be a bit lumpy, and if you go looking to buy SSL certificate, they can also be spendy. But times have changed, and an organization called Let’s Encrypt offers free SSL certificates for individuals. It can leverage a utility called Cert Bot to automatically generate and renew your certificates. How cool is that!? EFF had an extremely easy installation guide as well.