Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Further improvements to server documentation. No code changes. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
b91754ab851581f0286a43b53f6e1975 |
| User & Date: | drh 2013-08-13 23:05:27.158 |
Context
|
2013-08-14
| ||
| 14:30 | Added the Hacker How-To page with a link on the home page. Other documentation enhancements and typo fixes. ... (check-in: 04af93e619 user: drh tags: trunk) | |
|
2013-08-13
| ||
| 23:05 | Further improvements to server documentation. No code changes. ... (check-in: b91754ab85 user: drh tags: trunk) | |
| 19:57 | Fixed a typo in error text which never triggers. Manifest crosslinking's update of the event table now shows the tag value for a +closed/-closed tag if it is available (the default client does not currently add a value for those but the prototype one can). ... (check-in: 902135f747 user: stephan tags: trunk) | |
Changes
Changes to www/embeddeddoc.wiki.
| ︙ | ︙ | |||
101 102 103 104 105 106 107 | CGI mode. The "index.html" CGI script looks like this: <blockquote><pre> #!/usr/bin/fossil repository: /fossil/fossil.fossil </pre></blockquote> | | | | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | CGI mode. The "index.html" CGI script looks like this: <blockquote><pre> #!/usr/bin/fossil repository: /fossil/fossil.fossil </pre></blockquote> This is one of four ways to set up a <a href="./server.wiki">fossil web server</a>. The "<b>/trunk/</b>" part of the URL tells fossil to use the documentation files from the most recent trunk check-in. If you wanted to see an historical version of this document, you could substitute the name of a check-in for "<b>/trunk/</b>". For example, to see the version of this document associated with check-in [9be1b00392], simply replace the "<b>/trunk/</b>" with |
| ︙ | ︙ |
Changes to www/index.wiki.
| ︙ | ︙ | |||
89 90 91 92 93 94 95 |
Fossil uses plain old HTTP (with
[./quickstart.wiki#proxy | proxy support])
for all network communications, meaning that it works fine from behind
restrictive firewalls. The protocol is
[./stats.wiki | bandwidth efficient] to the point that Fossil can be
used comfortably over a dial-up internet connection.
| | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
Fossil uses plain old HTTP (with
[./quickstart.wiki#proxy | proxy support])
for all network communications, meaning that it works fine from behind
restrictive firewalls. The protocol is
[./stats.wiki | bandwidth efficient] to the point that Fossil can be
used comfortably over a dial-up internet connection.
6. <b>CGI/SCGI Enabled</b> -
No server is required to use fossil. But a
server does make collaboration easier. Fossil supports four different
yet simple [./server.wiki | server configurations].
The most popular is a 2-line CGI script. This is the approach
used by the [./selfhost.wiki | self-hosting fossil repositories].
7. <b>Robust & Reliable</b> -
Fossil stores content using an [./fileformat.wiki | enduring file format]
in an SQLite database so that transactions are
atomic even if interrupted by a power loss or system crash. Furthermore,
|
| ︙ | ︙ |
Changes to www/quickstart.wiki.
| ︙ | ︙ | |||
283 284 285 286 287 288 289 |
<p>This will back out the changes that the merge or update made to the
working checkout. There is also a [/help/redo|redo] command if you undo by
mistake. Undo and redo only work for changes that have
not yet been checked in using commit and there is only a single
level of undo/redo.</p>
| < > | | > < < < | > | | < < < < < | < < < < < < < | < < < < | < < < < | | < < | < < | < | < < < < < < | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
<p>This will back out the changes that the merge or update made to the
working checkout. There is also a [/help/redo|redo] command if you undo by
mistake. Undo and redo only work for changes that have
not yet been checked in using commit and there is only a single
level of undo/redo.</p>
<h2>Setting Up A Server</h2>
<p>Fossil can act as a stand-alone web server using one of these
commands:</p>
<blockquote>
<b>[/help/server | fossil server]</b> <i>repository-filename</i><br>
<b>[/help/ui | fossil ui]</b> <i>repository-filename</i>
</blockquote>
<p>The <i>repository-filename</i> can be omitted when these commands
are run from within an open check-out, which a particularly useful
shortcut for the <b>fossil ui</b> command.
<p>The <b>ui</b> command is intended for accessing the web interface
from a local desktop. The <b>ui</b> command binds to the loopback IP
address only (and thus makes the web interface visible only on the
local machine) and it automatically start your web browser pointing at the
server. For cross-machine collaboration, use the <b>server</b> command,
which binds on all IP addresses and does not try to start a web browser.</p>
<p>Servers are also easily configured as:
<ul>
<li>[./server.wiki#inetd|inetd/xinetd]
<li>[./server.wiki#cgi|CGI]
<li>[./server.wiki#scgi|SCGI]
</ul>
<p>The the [./selfhost.wiki | self-hosting fossil repositories] use
CGI.
<a name="proxy"></a>
<h2>HTTP Proxies</h2>
<p>If you are behind a restrictive firewall that requires you to use
an HTTP proxy to reach the internet, then you can configure the proxy
in three different ways. You can tell fossil about your proxy using
|
| ︙ | ︙ |
Changes to www/server.wiki.
1 | <title>How To Configure A Fossil Server</title> | | | | > > > > > > > > > > > | < < | | | < > > | > | > > > | | | | < | < | < < < < | < < < < < < < < < < < < | | > > | | | | > | > > | | | > > > > | | < < < > | | | < < < | | | | > | | | < < < < | < > > | < | | | | < | | | | | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
<title>How To Configure A Fossil Server</title>
<p>A server is not necessary to use Fossil, but it does help in collaborating with
peers. This article is a guide for setting up a Fossil server.</p>
<h2>Overview</h2><blockquote>
There are basically four ways to set up a Fossil server:
<ol>
<li>A stand-alone server
<li>Using inetd or xinetd
<li>[https://en.wikipedia.org/wiki/Common_Gateway_Interface|CGI]
<li>[http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface|SCGI]
</ol>
Each of these can serve either a single repository, or a directory hierarchy
containing many repositories with names ending in ".fossil".
</blockquote>
<a name="standalone"></a>
<h2>Standalone server</h2><blockquote>
The easiest way to set up a Fossil server is to use either the
[/help/server|server] or the [/help/ui|ui] commands:
<ul>
<li><b>fossil server</b> <i>REPOSITORY</i>
<li><b>fossil ui</b> <i>REPOSITORY</i>
</ul>
<p>
The <i>REPOSITORY</i> argument is either the name of the repository file, or
a directory containing many repositories.
Both of these commands start a Fossil server, usually on TCP port 8080, though
a higher numbered port might also be used if 8080 is already occupied. You can
access these using URLs of the form <b>http://localhost:8080/</b>, or if
<i>REPOSITORY</i> is a directory, URLs of the form
<b>http://localhost:8080/</b><i>repo</i><b>/</b> where <i>repo</i> is the base
name of the repository file without the ".fossil" suffix.
The difference between "ui" and "server" is that "ui" will
also start a web browser and points it
to the URL mentioned above, and "ui" command binds to
the loopback IP address (127.0.0.1) only so that the "ui" command cannot be
used to serve content to a different machine.
</p>
<p>
If one of the commands above is run from within an option checkout,
then the <i>REPOSITORY</i> argument can be omitted and the checkout is used as
the repository.
</p>
<p>
Both commands have additional command-line options that can be used to refine
their behavior. See the [/help/server|online documentation] for an overview.
</p>
</blockquote>
<a name="inetd"></a>
<h2>Fossil as an inetd/xinetd service</h2><blockquote>
<p>
A Fossil server can be launched on-demand by inetd or xinetd using
the [/help/http|fossil http] command. To launch Fossil from inetd, modify
your inetd configuration file (typically "/etc/inetd.conf") to contain a
line something like this:
<blockquote>
<pre>
12345 stream tcp nowait.1000 root /usr/bin/fossil /usr/bin/fossil http /home/fossil/repo.fossil
</pre>
</blockquote>
In this example, you are telling "inetd" that when an incoming connection
appears on port "12345", that it should launch the binary "/usr/bin/fossil"
program with the arguments shown.
Obviously you will
need to modify the pathnames parts as appropriate for your particular setup.
The final argument is either the name of the fossil repository to be served,
or a directory containing multiple repositories.
</p>
<p>
If you system is running xinetd, then the configuration is likely to be
in the file "/etc/xinetd.conf" or in a subfile of "/etc/xinetd.d".
An xinetd configuration file will appear like this:</p>
<blockquote>
<pre>
service http-alt
{
port = 591
socket_type = stream
wait = no
user = root
server = /usr/bin/fossil
server_args = http /home/fossil/repos/
}
</pre>
</blockquote>
<p>
The xinetd example above has Fossil configured to serve multiple
repositories, contained under the "/home/fossil/repos/" directory.
</p>
<p>
In both cases notice that Fossil was launched as root. This is not required,
but if it is done, then Fossil will automatically put itself into a chroot
jail for the user who owns the fossil repository before reading any information
off of the wire.
</p>
<p>
Using inetd or xinetd is a more complex setup
than the "standalone" server, but it has the
advantage of only using system resources when an actual connection is
attempted. If no-one ever connects to that port, a Fossil server will
not (automatically) run. It has the disadvantage of requiring "root" access
and therefore may not normally be available to lower-priced "shared" servers
on the internet.
</p>
</blockquote>
<h2>Fossil as CGI</h2><blockquote>
<p>
A Fossil server can also be run from an ordinary web server as a CGI program.
This feature allows Fossil to be seamlessly integrated into a larger website.
CGI is how the [./selfhost.wiki | self-hosting fossil repositories] are
implemented.
</p>
<p>
To run Fossil as CGI, create a CGI script (here called "repo") in the CGI directory
of your web server and having content like this:
<blockquote><pre>
#!/usr/bin/fossil
repository: /home/fossil/repo.fossil
</pre></blockquote>
</p>
<p>
As always, adjust your paths appropriately.
It may be necessary to set permissions properly, or to modify an ".htaccess"
file or other server-specific things like that. Consult the documentation
for your particular server.
</p>
<p>
Once the script is set up correctly, and assuming your server is also set
correctly, you should be able to access your repository with a URL like:
<b>http://mydomain.org/cgi-bin/repo</b> (assuming the "repo" script is
accessible under "cgi-bin", which would be a typical deployment on Apache
for instance).
</p>
<p>
To server multiple repositories from a directory using CGI, use the "directory:"
tag in the CGI script rather than "repository:". You might also want to add
a "notfound:" tag to tell where to redirect if the particular repository requested
by the URL is not found:
<blockquote><pre>
#!/usr/bin/fossil
directory: /home/fossil/repos
notfound: http://url-to-go-to-if-repo-not-found/
</pre></blockquote>
</p>
<p>
Once deployed, a URL like: <b>http://mydomain.org/cgi-bin/repo/XYZ</b>
will serve up the repository "/home/fossil/repos/XYX.fossil" (if it exists).
</p>
</blockquote>
<h2>Fossil as SCGI</h2><blockquote>
<p>
The [/help/server|fossil server] command, described above as a way of
starting a stand-alone web server, can also be used for SCGI. Simply add
the --scgi command-line option and the stand-alone server will interpret
and respond to the SimpleCGI or SCGI protocol rather than raw HTTP. This can
be used in combination with a webserver (such as [http://nginx.org|Nginx])
that does not support CGI. A typical Nginx configuration to support SCGI
with Fossil would look something like this:
<blockquote><pre>
location ~ ^/demo_project/ {
include scgi_params;
scgi_pass localhost:9000;
scgi_param SCRIPT_NAME "/demo_project";
}
</pre></blockquote>
<p>
Note that Fossil requires the SCRIPT_NAME variable
in order to function properly, but Nginx provides does not provide this
variable by default.
So it is necessary to provide the SCRIPT_NAME parameter in the configuration.
Failure to do this will cause Fossil to return an error.
</p>
<p>
All of the features of the stand-alone server mode described above,
such as the ability to server a directory full of Fossil repositories
rather than just a single repository, work the same way in SCGI mode.
|
| ︙ | ︙ | |||
231 232 233 234 235 236 237 | administrators of your server will be able to access your data (as with any hosting service setup). The only workaround in this case is to host the server yourself, in which case you will need to allocate resources to deal with administration issues. </p> </blockquote> | < < | 228 229 230 231 232 233 234 | administrators of your server will be able to access your data (as with any hosting service setup). The only workaround in this case is to host the server yourself, in which case you will need to allocate resources to deal with administration issues. </p> </blockquote> |