Hello, and Welcome. My name is Denis Kirpichenkov, and I’m a Java developer who likes DevOps too ;) In my first post will tell you how to get very powerful Content Management System, and how to get free hosting for it.
I tried many times to start blogging, but again and again I failed. The one of reasons was CMS. I could find content system to fit all of my needs. But now, I hope I found The One. I’m talking about Octopress. It is a powerful and simple Content Management System, which is for say is not a CMS at all. I’m will briefly describe its features in this post.
The next important step in blogging is a hosting. I tried Amazon’s EC2 tiny instance, Digital Ocean’s 5-dollars-per-month-vm. They didn’t fit my needs as well. I had to maintain them, and this process takes time. It is a big problem for me. I found the best hosting I’ve ever dreamt - GitHub. Below I will tell how to make GitHub to host your blog for FREE.
Octopress is not a CMS in common sense. It is a bunch of ruby scripts that generates static html pages to host your posts. So, your blog will be blazing fast. You have some customization point such as themes, page templates. I promise I’ll write about it after I’ll try it on this blog. I read about Octopress somewhere, google it, and thought that it is woth trying.
First of all, you have to get it from github
git clone git://github.com/imathis/octopress.git octopress
Next, make initial preparations
cd octopress && bundle install
After it you need to run
Ubuntu 16.04 I don’t know why at the moment, but if you run
rake SOMETHING you’ll get wierd error, that tells nothing.
1 2 3 4
The quick solution is to use
/usr/bin/rake instead of
After you’ve done Octopress installation, you can test it. Just run
rake preview and open browser at
Making post is as easy as run
rake new_post["This is a fisrt post"] It will create a markdown file in
You are free to write whatever you want in this post in markdown. To make it a bit easier here is markdown cheat sheet
When you are ready to publish your blog you have to run
rake generate. This command will produce everything you need to serve blog in
So, after generation you are free to upload public to whatever you want hosting, and have your blog online.
GitHub as a free hosting
After you’ve cloned a Octopress repo from github you can use it as your own repo for blog. First you need to run
This command will ask you about url to your github repository to work with
Enter the read/write url for your repository
You may answer something like this
Don’t forget to change USERNAME to your github’s login, and REPOSITORY to your repository name
Next, add your remote repo to your local repo by running
git remote add origin email@example.com:USERNAME/REPOSITORY.git
The next step is renaming current branch from ‘master’ to ‘source’ with
git branch -m master source
After that, generate everything with
Add the whole directory with Octopress and your post to a git with
git add .
git commit -am "First commit to github."
Push it to github
git push origin source
Deploy generated content to GitHub
If you github repo is something like
d0k1/focusit you’ll face a problem - deployed blog would not find resources like static content (css, images).
To solve this you need to run
To revert changes run
After you done it, update
document_root = "~/d0k1.github.io/focusit"
You can add custom domain to you github pages based blog. To make it you need to create two file inside
CNAME should contain you custom domain, for example
After it you can ypddate you repository
1 2 3 4 5
Do not forget to update your DNS to forward requests from you custom domain to github’s servers. You need know what ip servers you repostiry
After I ran
dig d0k1.github.io +nostats +nocomments +nocmd
1 2 3 4 5
Now I know IP of server that process request to my repository (d0k1.github.io) - 126.96.36.199
And now I have to add to DNS
@ A 188.8.131.52
So, that’s how I get my blog on focus-it.ru up and running on free hosting with a great “CMS”