Skip to content

Command Line Interface

benbjohnson edited this page Oct 3, 2010 · 5 revisions

Overview

Smeagol is packaged with two binaries:

  • smeagol - The server binary.
  • smeagold - The command for daemonizing the Smeagol server.

If you are setting up or testing a Smeagol installation, start by using the smeagol command directly. It allows you to start and stop your server quickly and allows you to see logging information in your console. Once your server is setup, use the smeagold command to run your server as a background process.

Options

The following command line options are availale:

  • --port or -p - The port to run the server on. (Default 4567)
  • --git - The path to the local git binary. If not specified, it is automatically search for in /usr/bin, /usr/sbin, /usr/local/bin and /opt/local/bin.
  • --config or -c - The path to the configuration file. When specified, the global configuration is ignored.
  • --auto-update - Automatically updates the Gollum repository once per day.
  • --no-cache - Turns off page caching.

The last parameter in the command is the path to the Gollum repository. If omitted and no repositories are specified in the configuration file, the current directory is used.

Configuration File

All the command line options can be specified in a configuration file. The configuration file is in YAML format and most command line options are available in the configuration file. If no configuration file is specified on the command line, the global configuration file at /etc/smeagol/config.yml will be used.

The options are:

  • port - The bind port.
  • git - The git path.
  • auto_update - A flag stating if auto update is enabled. Either true or false.
  • cache_enabled - A flag stating if page caching is enabled. Either true or false.
  • repositories - An array of repository objects. Each repository has a two settings: path and cname.

Below is an example configuration file:

port: 80
git: /root/git
auto_update: true
cache_enabled: true

repositories:
  - path: /root/wikis/my_wiki
    cname: mycoolwiki.com
  - path: /root/wikis/my_other_wiki
    cname: wiki.example.com

Multiple Repository Support

As shown in the YAML example above, multiple repositories can be served by the same Smeagol instance. This is done by specifying the CNAME attribute for the domain or subdomain that the wiki will be served from.

The first wiki specified in the configuration file or the command line repository (if specified) is the default repository. If a page is served from an unspecified domain then the default repository will be used.

Daemonize

To daemonize the Smeagol server, use the smeagold command. The smeagold command accepts the following commands:

  • start - Starts the server.
  • stop - Stops the already running server.
  • restart - Restarts the server.
  • run - Runs the server without daemonizing it. This is useful for testing the smeagold command.

To pass command line arguments to your server, specify them after double dashes (--) like this:

$ smeagold start -- -p 80 /path/to/repo
Clone this wiki locally