cloud, LAMP, SSL, wordpress

Cloud based server and virtual networking using Oracle cloud

creating a free vm in oracle cloud

While studying for the Comptia Network+ exam, I used Oracle's cloud service to set up virtual networks in the cloud to practice with. Oracle's has some "always free" services and a free trial month, as I don't have access to these kind of resources through work or at home it was useful to be able to practice and ingrain some of the concepts while preparing for the exam. Having achieved that certification I'm now studying towards the Comptia Security+ exam, and I'll be getting more practice hands on with the cloud labs.

Oracle cloud's "always free" tier allows you to run a few VM instances (using their pre-defined "free" profiles) and configure them how you like in public or private subnets.. There's also various other resources available in the free tier to set up internet gateways, VPN connections, NAT gateways etc. With the trial account they also provide a small amount of free credit to try other paid-for services they have available for a period of one month, so there's plenty to build labs and practice with before sitting the exam.

creating a VM in oracle cloud

Here is an example of using the available free machines, to set up this very server hosting this page. One machine in a public subnet running Apache set up and WordPress and another machine running the MySQL server in a private subnet. Both machines are running Ubuntu minimal (the "always free" VM shapes available are not particularly powerful!).

image showing Oracle's route analysis tool Oracle cloud's route analysis tools

By default the networks set up are heavily locked down (which is good), so everything has to be manually added, internet gateways for public subnets and NAT for the private subnet (to allow updates etc.). The ACL for the network and route tables for the subnets have to be created, and individual firewalls configured on each machine. I ran in to a small problem here- despite installing ufw and it seeming to be set up correctly, the webserver was still failing to get a connection to the MySQL server, after a fair bit of searching I found that Oracle's images don't seem to play nicely with ufw so I removed it and just used plain old iptables and everything worked as expected.

I already had this domain name, so it was just a case of assigning a fixed IP to the webserver and heading to my provider to update my DNS record to point to this address. I also had to set up new SSL certificates for Apache (via letsencrypt), which was fairly straightforward with PPAs available for Ubuntu to run through the initial set up as well as keeping them updated.
I'm pretty impressed that you can host a (small) site for free using Oracle cloud, and not just a ready hosted site but an actual machine(s) where you can install things exactly how you want them (apache/nginx, php, whatever kind of database you want etc.). I also have some other services running here which I previously ran using "Azure app service" but on azure I couldn't have them running 24/7 without upgrading and potentially racking up charges.

It's worth noting that the free tier account has some limitations-
Although there are supposedly more powerful VM shapes available as "always free" using ampere processors, I haven't been able to try them as there doesn't seem to be any available on any of the UK availability domains whenever I've tried to create one. I'm guessing they are reserving enough for use by actual paying customers (which is fair), at the end of the trial month I will probably upgrade to a pay as you go account and hopefully they'll be more availability for that tier.
Also Oracle note that 'unused' compute instances (VMs) on the free tier will be reclaimed (deleted)- and these machines will probably fall below the threshold to be classified as 'unused'. Upgrading to the payg tier should avoid this reclaiming and the "always free" limits still apply, so as long as I keep careful to avoid suprise charges I should be fine to keep them running even after the trial ends.