Setting Up Jekyll on Windows Azure

2014-01-12 12:00Edit this page

I just1 received an email from Windows Azure:

You are invited to participate in the Windows Azure beta free trial operated by 21Vianet

I was lucky enough to get a Windows Azure beta trial VPS, and they didn’t specify an expiration date, so it looks like I can use it for free for at least three months.2

Of course, this VPS is on the domestic network, so “setting up a ladder” (VPN) is out of the question. But I can still host a blog on it.

So I migrated my Jekyll blog from GitHub Pages3 (at least I don’t need to start a VM to write blog posts - I can just log into the VPS directly).

Setting Up a Jekyll Environment

When creating the virtual machine on Windows Azure, I chose CentOS (mainly because I use it at work), then next, next… and the VM was created.

Then I opened an SSH terminal, entered the hostname, port, username, and password that I filled in when creating the VM, and logged into the virtual machine.

The first thing after logging in was to edit the /etc/yum.conf file:

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
# exclude=kernel*
#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

Comment out exclude=kernel*, otherwise you’ll get errors when installing packages.

Since Jekyll requires a Ruby environment, execute the following command in the terminal to install Ruby:

$ curl -L https://get.rvm.io | bash -s stable --ruby

For Jekyll installation, as stated in the official Jekyll documentation, execute in the terminal:

$ gem install jekyll

But when I ran this command, I found that gem wasn’t responding. I then ran:

$ gem install jekyll -V

I discovered that the lack of response was because the gem source was inaccessible due to domestic network restrictions (you know what I mean).

I immediately followed the documentation at http://ruby.taobao.org/, removed the inaccessible source, and updated to Taobao’s mirror.

$ gem sources --remove https://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***

http://ruby.taobao.org

Then I ran:

$ gem install jekyll

It was fast and smooth. ^_^


Postscript

But I still don’t know if I can point a domain without ICP registration to it… so I’m still using that long, ugly, and hard-to-remember xxxxxx.chinacloudapp.cn4… =w=

Notes added on 2018-10-10


  1. I should avoid using words like “just” in articles in the future - looking back years later only adds to the sentiment ↩︎

  2. After searching through emails, this trial ended on 2015/3/18 ↩︎

  3. Looking back now, this migration was completely unnecessary - being able to dig up old blog posts is entirely thanks to GitHub ↩︎

  4. I have no memory of this domain at all - seems like writing blog posts is indeed necessary ↩︎

Unless otherwise stated, articles on this blog are licensed under the Creative Commons Attribution 4.0 International License. Please credit the original author and source when sharing.


Tags: archive

Leave a comment

Creative Commons © 2013 — 2026 xiaocang | Theme based on fzheng.me & NexT | Hosted by Netlify