Setting up this Blog Part 1
How to set up a blog with gatling, Jekyll and CentOS Part 1.
Table of contents:
Intro
I wanted to try blogging again. So I checked for software I could use. I absolutely hate Wordpress and Co because it’s simply to much stuff for just posting a random article or two. While searching for a simple blogging software I looked at one of my favorite blogs namely fefes blog. He is using a non disclosed C program to format his Blog and then publishes it with his own brand of web server. EDIT: Source Code for fefes blog can be found here.
In my search for a simple blog software I found Jekyll. I liked it because it generates static files which can be hosted by about anything and is highly customizable without messing around with this dreadful php stuff.
So all I needed now was a web server. I didn’t want apache because apache is bloated. I tried configuring nginx and broke it twice I think. After contemplating just hacking my own in GO I looked again to fefe and found that while his blog software is not published his web servers are. He has written two different web servers gatling and fnord. While the latter is no longer developed further the former is. So I decided on gatling.
Everything further presumes you have the normal building tools installed.
Installing gatling proved more difficult then I envisioned. Yes one can run make && make install
but somehow just running it naively produces error messages. Well thank god I sometimes listen when everything screams RTFM at me. So… RTFM? let’s have a look if there is a readme file:
Well then… README tells me I need libowfat
. Let’s install that first:
Going to fefe’s libowfat page tells me I also should use diet libc
…
diet libc
Get it from here either using cvs or download the tar
ball.
After extracting it cd
to the directory and make
. Many Many lines of gcc
output later it’s finished.
The README tells me I need to run install bin-x86_64/diet /usr/local/bin
to use it.
make install
yields some errors which I ignore. Maybe everything works allright.
That was all that was necessary to install diet libc.
libowfat
Get it from here again either using cvs or download the tar
ball.
Here a simple make && make install
does the trick.
gatling
Finally I can install gatling
Hmm this is not working therefore: yum install openssl openssl-devel openssl-static
. Again:
Ok. Dammn it all to hell I don’t need ssl support. I use cloudflare which does my ssl for me. Futhermore nobody except cloudflare can access my web server. Have a look here for my firewall script which ensures this.
Finally I have a gatling binary. Yay^^
A quick cp gatling /usr/bin/
later I can run my server by calling gatling
.
CentOS (systemd)
Now that I have my gatling binary I need to run it at startup. I could add a line in my cron file but I wanted to make it right…ish. CentOS uses systemd and fefe’s strong dislike (warning his blog is in german) notwithstanding I wanted to use it to start and stop my sever. After reading the man page for systemd I came up with the following: Yes it’s not that nice and kinda hackish but it works.
Interim Conclusion
At this point I have a running webserver which can be started by typing systemctl start gatling
. Now all I have to do is set up a jekyll website and a git repository so I can modify said website from everywhere. Provided everywhere has a git client and a text editor.
This concludes part 1 have a look here for part 2.