Articles

Gollum on Ubuntu/Linux Mint

In howto on Sep 11, 2013 by theoryl Tagged: , , , , , , , ,

Gollum is the wiki engine that is developed and deployed by GitHub. The codes are hosted at https://github.com/gollum/gollum. It supports many syntaxes, including Markdown, ReStructuredText, Textile, MediaWiki, etc. To install:

On Linux Mint 13 “Maya” (based on Ubuntu 12.04 “Precise Pangolin”), first get Ruby and RubyGems:

sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems1.9.1

Then install Gollum via RubyGems:

sudo gem install gollum

An alternative to install Gollum is to build from source (taking version 2.5.0 as example):

git clone git@github.com:gollum/gollum.git
cd gollum
gem build gollum.gemspec
sudo gem install gollum-2.5.0.gem

If you build Gollum from source, you might also want to build its library from source (https://github.com/gollum/gollum-lib).

To use it, simply create a Git repository:

mkdir ~/Wiki
cd ~/Wiki
git init
gollum .

Now point the browser to http://localhost:4567/, and you have a fully functional Wiki site up and running. As a bonus, it is automatically versioned by Git every time you create/edit a Wiki entry.

One downside thus far is that Gollum doesn’t support multiple repositories and multiple users.


One might want to run Gollum as a service/daemon with Upstart. For Upstart prior to v1.7 (my version is 1.5), “User Job” is disabled by default (for Ubuntu/Linux Mint), see http://upstart.ubuntu.com/cookbook/#enabling. To enable, I edited /etc/dbus-1/system.d/Upstart.conf as such:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE busconfig PUBLIC
  "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">

<busconfig>
  <!-- Only the root user can own the Upstart name -->
  <policy user="root">
    <allow own="com.ubuntu.Upstart" />
  </policy>

  <!-- Permit the root user to invoke all of the methods on Upstart, its jobs
       or their instances, and to get and set properties. -->
  <policy user="root">
    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="org.freedesktop.DBus.Properties" />

    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="com.ubuntu.Upstart0_6" />
    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="com.ubuntu.Upstart0_6.Job" />
    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="com.ubuntu.Upstart0_6.Instance" />
  </policy>

  <!-- Allow any user to introspect Upstart's interfaces, to obtain the
       values of properties (but not set them) and to invoke selected
       methods on Upstart and its jobs that are used to walk information. -->
  <policy context="default">
    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="org.freedesktop.DBus.Introspectable" />

    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="org.freedesktop.DBus.Properties" />

    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="com.ubuntu.Upstart0_6" />

    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="com.ubuntu.Upstart0_6.Job" />

    <allow send_destination="com.ubuntu.Upstart"
	   send_interface="com.ubuntu.Upstart0_6.Instance" />
  </policy>
</busconfig>

Then I made a script called ~/.init/gollum.conf (create the directory ~/.init if it doesn’t exist, and replace USERNAME with your username below):

# Gollum - A simple, Git-powered wiki with a sweet API and local frontend.

description "Init a web server running the Gollum frontend."

start on runlevel [2345]
stop on runlevel [!2345]

exec /usr/local/bin/gollum /home/USERNAME/Wiki/
respawn
respawn limit 10 5

Ask initctl to reload configurations:

initctl reload-configuration
# Check whether Gollum is running
initctl list | grep gollum
# If not, start Gollum manually
#start gollum
# To stop Gollum manually
#stop gollum
# To restart Gollum manually
#restart gollum

Happy writing wikis!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: