Apache HTTP(S) Server

This is the website that you're viewing right now! I built and deployed the entire thing from the ground up and do all of the maintenance and hosting myself. I've wanted to self-host a website for a while now as of writing this (January 2024) and decided that this was the time to do it. This entire project was actually one of my New Year's resolutions, but I was so excited to get started on it that I ended up with a functional website by the end of the month.

The site is currently being hosted on a Raspberry Pi running Ubuntu Server 23 and is sitting right next to my router. When starting this project I wasn't aware of the different server backends but I knew Apache was used a lot in the industry and that is was flexible enough for what I was trying to do. That didn't stop me from spending a few days researching different servers though. I ended up settling on Apache anyways (despite two of my classmates suggesting I use Nginx instead) and it has worked out great so far.

A picture of a Raspberry Pi connected to a power cable that goes out of frame. A red glow can be seen from inside the device's case. That's the server you're using right now, say hi!

Initially, I was just going to use this site as a sort of sandbox to improve my frontend development skills and generally mess around with HTTP as a whole. Because of this, I had no issue simply writing my IP address into the address bar, but quickly ran into an annoying quirk of my network; my ISP blocks inbound traffic on port 80!! I only discovered that after banging my head against my desk trying to figure out why I couldn't access my site from outside my network. When I found this out, I resigned to the fact that all of my plans for a self-hosted website were pointless as my ISP was preventing me (and everyone else) from accessing it without shamefully appending ":8080" to the end of my IP address. Even still, run an Nmap scan against my site and you'll see port 80 is still blocked!

After a few days I decided to do some research into how I can circumvent this block, and none of the solutions that I found worked very well for me. It was only then that I remembered that HTTPS does not operate on port 80 by default, but rather port 443. I ran a quick test with Nmap and found out that 443 was not filtered! We're back in business! After doing some research I learned that all I needed to do to use HTTPS was get a domain name (which I wanted to get anyways because I think it's cool) and an SSL certificate. The former was easy as domain names aren't terribly expensive and it wasn't hard to find one I liked. While researching domain names I discovered the existence of HSTS when I found a domain name that I liked (The one you used to connect to this site!) and that it is HSTS-preloaded, meaning not only will my ISP stop you from connecting on port 80, but your browser won't even let you try!

Unfortunately, this came with some issues when getting my SSL certificate. Like most other small sites, self-hosted or otherwise, I use Let's Encrypt and certbot to get SSL certs for my server. And anyone that's gone through that process knows that certbot requires you to complete a "challenge" to create your certs. Certbot's HTTP challenge is really nice and quick, and I would have used it if my ISP let me!! Instead, I use the DNS challenge, which isn't bad, it's just a huge pain to automatically renew certs, which is something I'm still working on.

That was about all it took to get where I am now. Since then I've been making frequent updates to the site, whether that's adding new content or cleaning up my backend (seriously, implementing an external style sheet and server-side includes saved me from way too much copy-pasting). This isn't a project I'm planning on calling "finished" any time soon, and even if I do end up paying for a host for some reason in the future, I am very glad I took up this project, as I have already learned so much about every aspect of developing and maintaining a web server.