File Annotation
Not logged in
e319e8e870 2007-08-25       drh: <html>
e319e8e870 2007-08-25       drh: <head>
e319e8e870 2007-08-25       drh: <title>Fossil Concepts</title>
e319e8e870 2007-08-25       drh: </head>
e319e8e870 2007-08-25       drh: <body bgcolor="white">
469002ccdf 2007-09-12       aku: <p>[ <a href="index.html">Index</a> ]</p>
469002ccdf 2007-09-12       aku: <hr>
e319e8e870 2007-08-25       drh: <h1 align="center">
e319e8e870 2007-08-25       drh: Fossil Concepts
e319e8e870 2007-08-25       drh: </h1>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h2>1.0 Introduction</h2>
e319e8e870 2007-08-25       drh: <p>
e319e8e870 2007-08-25       drh: <a href="index.html">Fossil</a> is a
e319e8e870 2007-08-25       drh: <a href="http://en.wikipedia.org/wiki/Software_configuration_management">
e319e8e870 2007-08-25       drh: software configuration management</a> system.
a938517964 2007-08-26       aku: Fossil is software that is designed to control and track the
e319e8e870 2007-08-25       drh: development of a software project and to record the history
e319e8e870 2007-08-25       drh: of the project.
e319e8e870 2007-08-25       drh: There are many such systems in use today.  Fossil strives to
e319e8e870 2007-08-25       drh: distinguish itself from the others by being extremely simple
e319e8e870 2007-08-25       drh: to setup and operate.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>This document is intended as a quick introduction to the concepts
e319e8e870 2007-08-25       drh: behind fossil.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h2>2.0 Composition Of A Project</h2>
e319e8e870 2007-08-25       drh: <img src="concept1.gif" align="right" hspace="10">
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>A software project normally consists of a "source tree".
e319e8e870 2007-08-25       drh: A source tree is a hierarchy of files that are used to generate
e319e8e870 2007-08-25       drh: the end product.  The source tree changes over time as the
e319e8e870 2007-08-25       drh: software grows and expands and as features are added and bugs
e319e8e870 2007-08-25       drh: are fixed.  A snapshot of the source tree at any point in time
e319e8e870 2007-08-25       drh: is called a "version" or a "baseline" of the product.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>A "repository" is a database that contains copies of all historical
e319e8e870 2007-08-25       drh: versions or baselines for a project.  Baselines are normally stored in the
e319e8e870 2007-08-25       drh: repository in a highly space-efficient compressed format (delta encoding).
e319e8e870 2007-08-25       drh: But that is an implementation detail that you the user need not worry over.
a938517964 2007-08-26       aku: Think of the repository as a safe place where all your old baselines are
e319e8e870 2007-08-25       drh: securely stored away and available for retrieval whenever you need
e319e8e870 2007-08-25       drh: them.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>A repository in fossil is a single file on your disk.  This file
a938517964 2007-08-26       aku: might be rather large (dozens or hundreds of megabytes for a large
e319e8e870 2007-08-25       drh: or long running project) but it is nevertheless just a file.  You
e319e8e870 2007-08-25       drh: can move it around, rename it, write it out to a memory stick, or
e319e8e870 2007-08-25       drh: do anything else you normally do with files.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Each source tree that is controlled by fossil is associated with
a938517964 2007-08-26       aku: a single repository on the local disk drive.  You can tie two or more
a938517964 2007-08-26       aku: source trees to a single repository if you want (though one
e319e8e870 2007-08-25       drh: tree per repository is the most common configuration.)  So a
e319e8e870 2007-08-25       drh: single repository can be associated with many source trees, but
e319e8e870 2007-08-25       drh: each source tree is associated with only one repository.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Fossil source tree may not overlap.  A fossil source tree is identified
e319e8e870 2007-08-25       drh: by a file named "_FOSSIL_" in the root directory of the source tree.  Every
e319e8e870 2007-08-25       drh: file that is a sibling of _FOSSIL_ and every file in every subfolder is
e319e8e870 2007-08-25       drh: considered potentially a part of the source tree.  The _FOSSIL_ file
e319e8e870 2007-08-25       drh: contains (among other things) the pathname of the repository with which
e319e8e870 2007-08-25       drh: the source tree is associated.  On the other hand, the repository has
e319e8e870 2007-08-25       drh: no record of its source trees.  So you are free to delete a source tree
e319e8e870 2007-08-25       drh: or move it around without consequence.  But if you move or rename or
e319e8e870 2007-08-25       drh: delete a repository, then any source trees associated with that repository
e319e8e870 2007-08-25       drh: will no longer be able to locate their repository and will stop working.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>When multiple developers are working on the same project, each
e319e8e870 2007-08-25       drh: developer typically has his or her own local repository and an associated
e319e8e870 2007-08-25       drh: source tree in which to work.  Developers share their work by
e319e8e870 2007-08-25       drh: "syncing" the content of their local repositories either directly
e319e8e870 2007-08-25       drh: or through a central server.  Changes can "push" from the local
e319e8e870 2007-08-25       drh: repository into a remote repository.  Or changes can "pull" from a
e319e8e870 2007-08-25       drh: remote repository into a local repository.  Or one can do a "sync"
a938517964 2007-08-26       aku: which is a shortcut for doing both a push and a pull at the same time.
a938517964 2007-08-26       aku: Fossil also has the concept of "cloning".  A "clone" is like a "pull",
e319e8e870 2007-08-25       drh: except that instead of beginning with an existing local repository,
e319e8e870 2007-08-25       drh: a clone begins with nothing and creates a new local repository that
f9f7cf5684 2007-11-24       drh: is a duplicate of a remote repository.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Communication between repositories is via HTTP.  Remote
e319e8e870 2007-08-25       drh: repositories are identified by URL.  You can also point a webbrowser
e319e8e870 2007-08-25       drh: at a repository and get human-readable status, history, and tracking
e319e8e870 2007-08-25       drh: information about the project.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h3>2.1 Identification Of Artifacts</h3>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>A particular version of a particular file is called an "artifact".
e319e8e870 2007-08-25       drh: Each artifact has a universally unique name which is the
e319e8e870 2007-08-25       drh: <a href="http://en.wikipedia.org/wiki/SHA">SHA1</a> hash of the content
e319e8e870 2007-08-25       drh: of that file expressed as 40 characters of lower-case hexadecimal.  Such
a938517964 2007-08-26       aku: a hash is referred to as the Universally Unique Identifier or UUID
e319e8e870 2007-08-25       drh: for the artifact.  The SHA1 algorithm is created with the purpose of
a938517964 2007-08-26       aku: providing a highly forgery-resistent identifier for a file.  Given any
e319e8e870 2007-08-25       drh: file it is simple to find the UUID for that file.  But given a
e319e8e870 2007-08-25       drh: UUID it is computationally intractable to generate a file that will
e319e8e870 2007-08-25       drh: generate that UUID.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>UUIDs look something like this:</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <blockquote><b>
e319e8e870 2007-08-25       drh: 6089f0b563a9db0a6d90682fe47fd7161ff867c8<br>
e319e8e870 2007-08-25       drh: 59712614a1b3ccfd84078a37fa5b606e28434326<br>
e319e8e870 2007-08-25       drh: 19dbf73078be9779edd6a0156195e610f81c94f9<br>
e319e8e870 2007-08-25       drh: b4104959a67175f02d6b415480be22a239f1f077<br>
e319e8e870 2007-08-25       drh: 997c9d6ae03ad114b2b57f04e9eeef17dcb82788
e319e8e870 2007-08-25       drh: </b></blockquote>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>When referring to an artifact using fossil, you can use a unique
e319e8e870 2007-08-25       drh: prefix of the UUID that is four characters or longer.  This saves
e319e8e870 2007-08-25       drh: a lot of typing.  When displaying UUIDs, fossil will usually only
e319e8e870 2007-08-25       drh: show the first 10 digits since that is normally enough to uniquely
e319e8e870 2007-08-25       drh: identify a file.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Changing (or adding or removing) a single byte in a file results
e319e8e870 2007-08-25       drh: in a completely different UUID.  And since the UUID is the name of
e319e8e870 2007-08-25       drh: the artifact, making any change to a file results in a new artifact.
e319e8e870 2007-08-25       drh: In this way, artifacts are immutable.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>A repository is really just an unordered collection of
e319e8e870 2007-08-25       drh: artifacts.  New artifacts can be added to the repository, but
e319e8e870 2007-08-25       drh: existing artifacts can never be removed.  Fossil is designed in
e319e8e870 2007-08-25       drh: such a way that it can be handed a set of artifacts in any
e319e8e870 2007-08-25       drh: order and it can figure out the relationship between those
e319e8e870 2007-08-25       drh: artifacts and reconstruct the complete development history of
e319e8e870 2007-08-25       drh: a software project.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h3>2.2 Manifests</h3>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>At the root of a source tree is a special file called the
e319e8e870 2007-08-25       drh: "manifest".  The manifest is a listing of all other files in
e319e8e870 2007-08-25       drh: that source tree.  The manifest contains the (complete) UUID
e319e8e870 2007-08-25       drh: of the file and the name of the file as it appears on disk,
e319e8e870 2007-08-25       drh: and thus serves as a mapping from UUID to disk name.  The UUID
e319e8e870 2007-08-25       drh: of the manifest is the UUID that identifies a baseline.  When
e319e8e870 2007-08-25       drh: you look at a "timeline" of changes in fossil, the UUID associated
e319e8e870 2007-08-25       drh: with each check-in or commit is really just the UUID of the
e319e8e870 2007-08-25       drh: manifest for that baseline.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Fossil automatically generates a manifest whenever you "commit"
e319e8e870 2007-08-25       drh: a new baseline.  So this is not something that you, the developer,
a938517964 2007-08-26       aku: need to worry with.  The format of a manifest is intentionally
f9f7cf5684 2007-11-24       drh: designed to be simple to parse, so that if
e319e8e870 2007-08-25       drh: you want to read and interpret a manifest, either by hand or
f9f7cf5684 2007-11-24       drh: with a script, that is easy to do.  But you will probably never
f9f7cf5684 2007-11-24       drh: need to do so.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>In addition to identifying all files in the baseline, a
e319e8e870 2007-08-25       drh: manifest also contains a check-in comment, the date and time
e319e8e870 2007-08-25       drh: when the baseline was established, who created the baseline,
e319e8e870 2007-08-25       drh: and links to other baselines from which the current baseline
e319e8e870 2007-08-25       drh: is derived.  There is also a couple of checksums used to verify
e319e8e870 2007-08-25       drh: the integrity of the baseline.  And the whole manifest might
e319e8e870 2007-08-25       drh: be PGP clearsigned.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h3>2.3 Key concepts</h3>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <ul>
e319e8e870 2007-08-25       drh: <li>A <b>baseline</b> or <b>version</b> is a set of files arranged
e319e8e870 2007-08-25       drh:     in a hierarchy.</li>
e319e8e870 2007-08-25       drh: <li>A <b>repository</b> keeps a record of historical baselines.</li>
e319e8e870 2007-08-25       drh: <li>Repositories share their changes using <b>push</b>, <b>pull</b>,
e319e8e870 2007-08-25       drh:     <b>sync</b>, and <b>clone</b>.</li>
e319e8e870 2007-08-25       drh: <li>A particular version of a particular file is an <b>artifact</b>
e319e8e870 2007-08-25       drh:     that is identified by a <b>UUID</b>.</li>
a938517964 2007-08-26       aku: <li>Artifacts tracked by fossil are inherently immutable.</li>
e319e8e870 2007-08-25       drh: <li>Fossil automatically generates a <b>manifest</b> file that identifies
e319e8e870 2007-08-25       drh:     every artifact in a baseline.</li>
e319e8e870 2007-08-25       drh: <li>The UUID of the manifest is the UUID of the baseline.</li>
e319e8e870 2007-08-25       drh: </ul>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h2>3.0 Fossil - The Program</h2>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Fossil is software.  The implementation of fossil is in the form
a938517964 2007-08-26       aku: of a single executable named "fossil".  To install fossil on your system,
e319e8e870 2007-08-25       drh: all you have to do is obtain a copy of this one executable file (either
e319e8e870 2007-08-25       drh: by downloading a precompiled version or compiling it yourself) and then
e319e8e870 2007-08-25       drh: putting that file somewhere on your PATH.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Fossil is completely self-contained.  It is not necessary to
e319e8e870 2007-08-25       drh: install any other software in order to use fossil.  You do <u>not</u> need
e319e8e870 2007-08-25       drh: CVS, gzip, diff, rsync, Python, Perl, Tcl, Java, apache, PostgreSQL, MySQL,
a938517964 2007-08-26       aku: SQLite, patch, or any similar software on your system in order to use
e319e8e870 2007-08-25       drh: fossil effectively.  You will want to have some kind of text editor
e319e8e870 2007-08-25       drh: for entering check-in comments.  Fossil will use whatever text editor
e319e8e870 2007-08-25       drh: is identified by your VISUAL environment variable.  Fossil will also
e319e8e870 2007-08-25       drh: use GPG to clearsign your manifests if you happen to have it installed,
e319e8e870 2007-08-25       drh: but fossil will skip that step if you do not have GPG so it is not
e319e8e870 2007-08-25       drh: essential.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>To uninstall fossil, simply delete the executable.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>To upgrade an older version of fossil to a newer version, just
e319e8e870 2007-08-25       drh: replace the old executable with the new one.  You might need to
e319e8e870 2007-08-25       drh: run a one-time command to restructure your repositories after
e319e8e870 2007-08-25       drh: an upgrade.  Check the instructions that come with the upgrade
e319e8e870 2007-08-25       drh: for details.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>To use fossil, simply type the name of executable in your
e319e8e870 2007-08-25       drh: shell, followed by one of the various built-in commands and
e319e8e870 2007-08-25       drh: arguments appropriate for that command.  For example:</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <blockquote><b>
e319e8e870 2007-08-25       drh: fossil help
e319e8e870 2007-08-25       drh: </b></blockquote>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>In the next section, when we say things like "use the <b>help</b>
e319e8e870 2007-08-25       drh: command" we mean to use the command name "help" as the first
e319e8e870 2007-08-25       drh: token after the name of the fossil executable, as shown above.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h2>4.0 Workflow</h2>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <img src="concept2.gif" align="right" hspace="10">
e319e8e870 2007-08-25       drh: <ol>
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: Establish a local repository using either the <b>new</b> command
e319e8e870 2007-08-25       drh: to start a new project, or the <b>clone</b> command to make a clone
e319e8e870 2007-08-25       drh: of a repository for an existing project.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: Establish one or more source trees by changing your working directory
e319e8e870 2007-08-25       drh: to where you want the root of the source tree to be, then issuing
e319e8e870 2007-08-25       drh: the <b>open</b> command with the name of the repository file as its
e319e8e870 2007-08-25       drh: argument.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: Use the <b>update</b> command followed by a UUID to cause your
e319e8e870 2007-08-25       drh: source tree to change to the baseline identified by that UUID.
e319e8e870 2007-08-25       drh: The <b>timeline</b> or <b>leaves</b> commands might help you to
e319e8e870 2007-08-25       drh: identify an appropriate baseline.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: Edit the code.  Add new files to the source tree using the <b>add</b>
e319e8e870 2007-08-25       drh: command.  Omit files from future baselines using the <b>rm</b> command.
e319e8e870 2007-08-25       drh: (Even when you remove files from future baselines, those files continue
e319e8e870 2007-08-25       drh: to exist in historical baselines.)  Test your changes.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: Create a new baseline using the <b>commit</b> command.  You will be prompted
e319e8e870 2007-08-25       drh: for a check-in comment and also for your GPG key if you have GPG installed.
e319e8e870 2007-08-25       drh: The commit copies the edits you have made in your local source
e319e8e870 2007-08-25       drh: tree into your local repository.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: Share your changes with others using the <b>push</b> command.
e319e8e870 2007-08-25       drh: Push causes the edits you committed into your local repository to be
e319e8e870 2007-08-25       drh: pushed out into other repositories.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: When your coworkers make their own changes, you can pull those changes
e319e8e870 2007-08-25       drh: into your local repository using the <b>pull</b> command.   Note that
e319e8e870 2007-08-25       drh: the pull command only pulls the changes into your local repository,
e319e8e870 2007-08-25       drh: not into your local source tree.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: After the changes of others are in your local repository, you
e319e8e870 2007-08-25       drh: can move them into your local source tree using <b>update</b>.  If
e319e8e870 2007-08-25       drh: you have made parallel
e319e8e870 2007-08-25       drh: changes, you can merge your changes together with your coworkers changes
e319e8e870 2007-08-25       drh: by do an <b>update</b> to your latest baseline, then doing a
e319e8e870 2007-08-25       drh: <b>merge</b> with your coworkers latest baseline.  After your
e319e8e870 2007-08-25       drh: verify that the merged code is still functional, you can <b>commit</b>
e319e8e870 2007-08-25       drh: a new baseline that contains both yours and your coworkers changes
e319e8e870 2007-08-25       drh: and then push the new baseline back to your coworker.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p>
e319e8e870 2007-08-25       drh: Repeat all of the above until you have generated great software.
e319e8e870 2007-08-25       drh: </p></li>
e319e8e870 2007-08-25       drh: </ol>
f9f7cf5684 2007-11-24       drh: 
f9f7cf5684 2007-11-24       drh: <h3>4.1 Variations</h3>
f9f7cf5684 2007-11-24       drh: 
f9f7cf5684 2007-11-24       drh: <p>The <b>settings</b> lets you view and modify various operating
f9f7cf5684 2007-11-24       drh: properties of fossil.  Among the available settings is "autosync"
f9f7cf5684 2007-11-24       drh: mode.  When autosync is enabled, the push and pull of content from
f9f7cf5684 2007-11-24       drh: your local server is largely automated.  Whenever you use the <b>update</b>
f9f7cf5684 2007-11-24       drh: command, fossil first does a <b>pull</b> to see if other users have
f9f7cf5684 2007-11-24       drh: perhaps added new baselines to the central repository.  When you
f9f7cf5684 2007-11-24       drh: <b>commit</b>, fossil also does a <b>pull</b> and issues a warning
f9f7cf5684 2007-11-24       drh: if your check-in would cause a fork.  After a <b>commit</b>, fossil
f9f7cf5684 2007-11-24       drh: automatically does a <b>push</b> to send your changes up to the
f9f7cf5684 2007-11-24       drh: central server.</p>
f9f7cf5684 2007-11-24       drh: 
f9f7cf5684 2007-11-24       drh: <p>With autosync enabled, fossil works like
f9f7cf5684 2007-11-24       drh: <a href="http://www.nongnu.org/cvs/">CVS</a> or
f9f7cf5684 2007-11-24       drh: <a href="http://subversion.tigris.org/">Subversion</a>.
f9f7cf5684 2007-11-24       drh: When autosync disabled, fossil works more like
f9f7cf5684 2007-11-24       drh: <a href="http://monotone.ca/">Monotone</a>,
f9f7cf5684 2007-11-24       drh: <a href="http://git.or.cz">GIT</a>, or
f9f7cf5684 2007-11-24       drh: <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a>.
f9f7cf5684 2007-11-24       drh: The fun thing about fossil is that it will work either
f9f7cf5684 2007-11-24       drh: way, depending on your needs of the moment.  You can freely switch
f9f7cf5684 2007-11-24       drh: between these operating modes using commands like:</p>
f9f7cf5684 2007-11-24       drh: 
f9f7cf5684 2007-11-24       drh: <blockquote>
f9f7cf5684 2007-11-24       drh: <b>fossil setting autosync off<br />
f9f7cf5684 2007-11-24       drh: fossil setting autosync on</b>
f9f7cf5684 2007-11-24       drh: </blockquote>
f9f7cf5684 2007-11-24       drh: 
f9f7cf5684 2007-11-24       drh: <p>For additional information about autosync and other settings
f9f7cf5684 2007-11-24       drh: using the <b>help</b> command.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <h2>5.0 Setting Up A Fossil Server</h2>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>With other configuration management software, setting up a server is
e319e8e870 2007-08-25       drh: a lot of work and normally takes time, patience, and a lot of system
e319e8e870 2007-08-25       drh: knowledge.  Fossil is designed to avoid this frustration.  Setting up
e319e8e870 2007-08-25       drh: a server with fossil is ridiculously easy.  You have three options:</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <ol>
e319e8e870 2007-08-25       drh: <li><p><b>Setting up a stand-alone server</b></p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>From within your source tree just use the <b>server</b> command and
e319e8e870 2007-08-25       drh: fossil will start listening for incoming requests on TCP port 8080.
e319e8e870 2007-08-25       drh: You can point your webbrowser at <a href="http://localhost:8080/">
e319e8e870 2007-08-25       drh: http://localhost:8080/</a> and begin exploring.  Or your coworkers
e319e8e870 2007-08-25       drh: can do pushes or pulls against your server.  Use the <b>--port</b>
e319e8e870 2007-08-25       drh: option to the server command to specify a different TCP port.  If
e319e8e870 2007-08-25       drh: you do not have a local source tree, use the <b>-R</b> command-line
e319e8e870 2007-08-25       drh: option to specify the repository file.</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>A stand-alone server is a great way to set of transient connections
e319e8e870 2007-08-25       drh: between coworkers for doing quick pushes or pulls.  But you can also
e319e8e870 2007-08-25       drh: set up a permanent stand-alone server if you prefer.  Just make
e319e8e870 2007-08-25       drh: arrangements for fossil to be launched with appropriate arguments
e319e8e870 2007-08-25       drh: after every reboot.</p>
e319e8e870 2007-08-25       drh: </li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p><b>Setting up a CGI server</b></p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>If you have a webserver running on your machine already, you can
e319e8e870 2007-08-25       drh: set up fossil to be run from CGI.  Simply create an executable script
e319e8e870 2007-08-25       drh: that looks something like this:</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <blockquote><pre>
e319e8e870 2007-08-25       drh: #!/usr/local/bin/fossil
e319e8e870 2007-08-25       drh: repository: /home/me/bigproject.fossil
e319e8e870 2007-08-25       drh: </pre></blockquote>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>Edit this script to use whatever pathnames are appropriate for
e319e8e870 2007-08-25       drh: your project.  Then point your webbrowser at the script and off you
e319e8e870 2007-08-25       drh: go.</p></li>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <li><p><b>Setting up an inetd server</b></p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>If you have inetd or xinetd running on your system, you can set
e319e8e870 2007-08-25       drh: those services up to launch fossil to deal with inbound TCP/IP connections
e319e8e870 2007-08-25       drh: on whatever port you want.  Set up inetd or xinetd to launch fossil
e319e8e870 2007-08-25       drh: like this:</p>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <blockquote><pre>
e319e8e870 2007-08-25       drh: /usr/local/bin/fossil http /home/me/bigproject.fossil
e319e8e870 2007-08-25       drh: </pre></blockquote>
e319e8e870 2007-08-25       drh: 
e319e8e870 2007-08-25       drh: <p>As before, change the filenames to whatever is appropriate for
e319e8e870 2007-08-25       drh: your system.  You can have fossil run as any user that has write
e319e8e870 2007-08-25       drh: permission on the repository and on the directory that contains the
e319e8e870 2007-08-25       drh: repository.  But it is safer to run fossil as root.  When fossil
e319e8e870 2007-08-25       drh: sees that it is running as root, it automatically puts itself into
e319e8e870 2007-08-25       drh: a <a href="http://en.wikipedia.org/wiki/Chroot">chroot jail</a> and
e319e8e870 2007-08-25       drh: drops all privileges prior to reading any information from the client.
e319e8e870 2007-08-25       drh: Since fossil is a stand-alone program, you do not need to put anything
e319e8e870 2007-08-25       drh: in the chroot jail with fossil in order for it to do its job.</p>
e319e8e870 2007-08-25       drh: </li>
e319e8e870 2007-08-25       drh: </ol>