Server Issues

Until January of 2023, I have been running this website thanks to Amazon AWS’s free 12-month EC2 instance and Github Student 1-year free domain. So February 2023 means, I now actually have to pay to keep the website afloat.

Domain wasn’t a big deal because I moved it to Google Domains, which provides local pricing. But server, it was a whole another deal.

Actually keeping the server on AWS is the best idea as they have the best infrastructure but it’s economically not viable for me. I’m a student in Turkey and 5$/month is not an outcome you can take while struggling to feed yourself. So I’ve decided to look for other alternatives.,

First alternative that came to my mind was Azure. So I started cosplaying as sysadmin and moved wordpress onto the Azure but turns out there were other things to consider about Azure.

Microsoft Azure Moving to Azure

I decided to use trial of Azure with my Microsoft account but as I said there are other things you have to consider on Azure and they make Azure more expensive and frustrating. These things can be summarized in 3 things.

1. Free Trial is valid for 1 month

Coming from AWS actually that surprised me because Amazon makes what is free and what is not very clear. Azure is not. If you look at their free tier page it looks like the AWS’s but their trial is for 1 month and they give you 200 usd credits to spend in that timeframe. After that they terminate your subscription until you upgrade to pay-as-you-go.

2. VM’s are free but disks are not

This surprised me a lot. Normally a B1s instance with Ubuntu 20.04 LTS costs around 8$/mo at Europe West Zone 2. I thought things are going just like AWS, that’s all you have to pay and Azure’s free tier works just like AWS but turns out it’s not.

Turns out there’s a charge for disks anyway. Storage amount (64GB) is free but storage type is priced. I tried standard SSD and premium SSD and results are same. I haven’t tried HDD option because modern operating systems doesn’t really move on HDDs. That actually surprised me but considering the speed, it’s fair enough. It’s an unnecessary cost for me tho!

3. You must use static IP

In AWS, you can use a dynamic IP and keep it on your VM unchanged as long as it’s running. You can even restart VM from ssh and they’ll still keep the IP unchanged. If you decide to use an static IP, you must pay for it when VM is turned off.

In Azure you must use and pay for a static IP in any case. You can create a “Basic” SKU public IP adress and use dynamic IP for it but they’re going to discontinue it in 2025. Because of that they don’t allow to attach it to new VMs. Actually that really makes sense if you’re doing production level things but for me it’s yet another unnecessary cost + I can use Cloudflare dynamic DNS scripts anyway.

Oracle Oracle Cloud for the rescue?

So due to high cost I’ve decided to look for other alternatives and found out about Oracle Cloud free tier. On paper, their freetier is the best. They offer always free VMs and they seem to be generous about that. Until you find out that they instaban nearly every new account. I couldn’t even upgrade to a paying customer. When I reached to their support using their ancient looking website, they said it will remain closed and terminated it.

That actually sucks. I was going to pay for extra disk capacity and install nextcloud on my instance. Oh, also their support process was painful, it took 2 weeks to conclude this saga and I missed a really great deal in the process. There’s actually more than that but I’m not going to write all of them in here. If you’re really curious send me a DM over Twitter or write to [email protected]

Enter, RackNerd

So I started for research for a cheap VPS. I first seen OVH’s first year 0.97$/mo promotion but when I tried to buy it something happened and it just disappeared (it was my mistake, not related to OVH). So I begin searching and on Reddit I found RackNerd. Actually they’re really cool, you can just use their Black Friday links to get 1 vCPU/1.5gb RAM/20GB SSD VPS for 16$/1 year. More than I can ask! Only catch is you can only use USA data-centers. While this creates some lag on ssh, I don’t really care as long as I can afford it.

Debian Amazon AWS Old Server Setup

Firstly, I would like to talk about the old setup. I just set it up using an Indian guy’s tutorial on YouTube. It was straightforward and I was able to set the website in moments. Server used AWS’s t2.micro instance and bitnami’s debian based WordPress image. Also it only run WordPress for an entire year because I thought I cannot run more than one application on 1 shared vCPU but turns out these vCPUs are miles more powerful than average netbook so they can run things like docker just fine.

Whatever, I want to talk about bitnami prepackaged WordPress image. Yes it’s really easy to set up but it has many disadvantages so because of them I advise anyone who wants to set up a website using AWS/VPS to get their hands dirty and set it up themselves.

Why bitnami bad?

Well, to their credit bitnami’s image didn’t really cause any catastrophic problems (except this). It worked well for a year thanks to my maintenance on the debian part.

Firstly, they did a fucking weird layout in their images. They state that packages like apache, mariadb, php and lego are installed through apt and they’re system packages… Welp, that’s a big lie. I don’t know whether they configured apt differently or not but everything is installed to the /opt/bitnami, they aren’t in the common places when you configure a LAMP stack manually. When I say everything, I mean EVERYTHING, binaries, logs, files, database etc. all in one folder. I don’t really know what’s the advantage of this layout because I’m not a sysadmin, just a cosplayer. But I can say one obvious disadvantage of this layout, it looks like apt doesn’t update apache and php as a consequence of this. Oops. So because of that I ran a website with outdated as fuck packages for a year (hey I think that’s what many big companies do tho so it might not be bad?).

Secondly, they actually update the image and write proper changes documents for them. That’s good and AWS Marketplace sends mails about them.

Ok, you’re making updates to the image, how can I update mine? Well here’s the thing, you can’t. AFAIK, it’s not possible with EC2. Remember, you have deployed it onto a virtual machine and now it’s a standalone “computer” in the internet. If you want to update it using a image, you have to wipe and deploy it from scratch. Makes sense right? Actually as I learned from later, that’s how docker images works (delete image except data and settings, replace it with the newer one) but that mechanism doesn’t really work well on a virtual machine and did I mention apt doesn’t update packages for some reason? Yikes. (I hate apt, xbps ftw)

Somewhere in 2022, image has been updated to the Debian 11 and around that time I updated my vm to Debian 11 manually. Which was easy and fixed the apt issue (it didn’t) and apache’s stopping problem every 2 days or so. (Seriously I looked to logs and everything, it’s not an attack or something it just exists for no reason and systemd doesn’t restart it automatically, you have to ssh into the machine and use bitnami’s restart script)

So that was everything about the old setup. Oh, also I have to mention that I accidentally deployed it to Ohio.

Ubuntu Microsoft Azure New Server Setup

So I moved onto Azure B1s instance. This time used Ubuntu Server 20.04 LTS because I’m familiar with Ubuntu. Everything on Azure was super fast. So seeing that I decided to look into Docker and oh boy, I wish I used it long ago. Containerization is awesome, you can run more than one instance of same image and it doesn’t know anything about other services. That means that, Azure actually taught me a valuable thing.

Ubuntu New New Server Setup

As I mentioned before, I got my new VPS from RackNerd. I went with Ubuntu Server 22.04 LTS this time, tho it wasn’t really different from 20.04 LTS. It’s a little bit different experience than cloud providers’.

They give you access to a panel that looks like KVM control panel on Linux, from there you can change boot order etc. Also from what I learned from Reddit, if you contact their support they mount whatever Linux distro ISO you give. Meaning that you can install Arch, Void, Fedora, whatever you want.

Instead of ssh private key system, they just give you root password. I’ve personally set-up ssh keys and root disable process manually. It’s easy also increases security.

I was tired of entering “sudo” every time I wanted to give a command to docker so I went with Podman. Also apparently it works with Kubernates but I’m not going to try it yet.

All in all, I was able to get my website to survive for another year on budget and learned a lot of things on the process. We’ll see if I’m going to be able to maintain it next year too.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.