What's the first thing you think when you learn about server-side-scripting and CGI for the first time? Obviously it's take your blog off of Blogger and rewrite your own platform... in C. At least that was my first thought. Luckily there are plenty of online resources to get started. This introduction
is particularly helpful and definitely worth reading if you're at all interested in the subject.
Anyways, I've now parted ways with Blogger and have moved my personal blog to an Amazon EC2 server running Ubuntu with Apache2 and my own CGI scripts.
To create my blog I broke it down to some basic elements that I wanted to include: a page to view posts, an info/contact page, a page to add/edit/delete posts, and a database to store everything. For a database I went with SQLite because of how modular the database data is. Since it's all stored in a single file it's easy to copy/backup etc. Once that was set up, each page basically becomes a pretty front-end for database queries. And to make it pretty I decided to make use of Twitter's Bootstrap
CSS styling because it takes very little effort to create an appealing looking layout that handles screen of all sizes. Which means that it looks nice on mobile and desktop screens.
I'm fairly happy with how everything turned out. Though there are some features missing that I would like to implement in the future such as a post timeline and a way to directly link to single posts. I think having direct links is important for sharing posts.
All the code has been uploaded to my Github
. Since a lot of the HTML was hard-coded into the source (instead of dynamically loaded from files) it serves mostly as a reference for how to do this type of project.