Serving a Jekyll-based GitHub Blog from Ubuntu
This post explains how to preview a blog on Ubuntu — either locally or from another machine on the same network.
[01] Setting Up Jekyll on Ubuntu
A service for registering websites with Google’s search engine so they can be discovered, and for monitoring search results. It works through web crawling.
- Install Ruby and the related packages.
1
2
sudo apt-get update
sudo apt-get install ruby-full build-essential zlib1g-dev
- Configure GEM so you don’t have to run it with
sudo— i.e., for convenience.GEM is Ruby’s library manager. Think of it as
apt-getspecialized for Ruby. - The configuration below should be done as a non-root user.
1 2 3 4
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc source ~/.bashrc
- Install Jekyll and Bundler.
1
gem isntall jekyll bundler
[02] Building or Downloading the GitBlog Site
- Clone an existing GitBlog site (git clone) and install the required packages.
1
2
3
# example
cd gitblog
bundle install
- Run the GitBlog service.
1 2 3 4
''' Run locally ''' jekyll serve ''' Run bound to the server IP so external clients can connect ''' jekyll serve --host=${Server IP address}