Bilal's Blog

Home - Blog - Updates

Hosting My Website Like a Caveman

About 6 months ago, I purchased the domain bilalhalim.xyz (now the domain of this site). I knew I wanted to host my own website, but I kept putting it off, partly because I did not know what I would put on it. And having just my resume and contact info is kind of dull. I wanted a place where I can post whatever I want, be it a blog, a photo gallery, or whatever really, without any kind of censorship which is usually enforced by almost all social media platforms.

Fortunately, it's never been easier for anyone to start a website. There are a plethora of online services that allow to purchase a domain, do the hosting, and even build the site using a drag and drop functionality. Those are cool and all, but most of the sites are filled with javascript and unneeded junk. I went the different route. The much more independent route of renting a remote server which gets great internet. This way, whoever pings or visits my site is using that server's internet and not mine. I say not mine because I was actually thinking of self-hosting, which comes with a lot of benifits. For starters, I can manage the hardware itself, fix it, upgrade it, and do whatever really. The downside to that is bandwidth, and eating up too much of my internet speeds.

I learned basic HTML and CSS, enough to do what I need to do. And frankly I do not need to do much; just display a photo of me, with a simple index page, and have my resume pdf file hosted, as well as another blog page. In my opinion, the best way to manage a site is offline. Editing the HTML and CSS, and once ready, uploading them to the server. For that, I use rsync, which is a great utility to sending files over the internet securely. I use rsync with these flags

rsync -rzvtP --delete-after ~/websitefiles/ root@example.org:/var/www/websitefiles

to keep both my home and server directories in sync. It also goes without saying that having an ssh key pair as well as disabling password logins is essential for keeping the hackers away. I use nginx as my webserver, and certbot to allow connections over HTTPS/SSL. I was considering using a static site generator, but they're all too bloated and complicated to use.

--------------------------------------------------------