|
1
|
# Standalone HTTP Server |
|
2
|
|
|
3
|
The easiest way to set up a Fossil server is to use either the |
|
4
|
[`server`](/help/server) or [`ui`](/help/ui) command: |
|
5
|
|
|
6
|
* **fossil server** _REPOSITORY_ |
|
7
|
* **fossil ui** _REPOSITORY_ |
|
8
|
|
|
9
|
The _REPOSITORY_ argument is either the name of the repository file or a |
|
10
|
directory containing many repositories named “`*.fossil`”. Both of these |
|
11
|
commands start a Fossil server, usually on TCP port 8080, though a |
|
12
|
higher numbered port will be used instead if 8080 is already occupied. |
|
13
|
|
|
14
|
You can access these using URLs of the form **http://localhost:8080/**, |
|
15
|
or if _REPOSITORY_ is a directory, URLs of the form |
|
16
|
**http://localhost:8080/**_repo_**/** where _repo_ is the base name of |
|
17
|
the repository file without the “`.fossil`” suffix. |
|
18
|
|
|
19
|
There are several key differences between “`ui`” and “`server`”: |
|
20
|
|
|
21
|
* “`ui`” always binds the server to the loopback IP address (127.0.0.1) |
|
22
|
so that it cannot serve to other machines. |
|
23
|
|
|
24
|
* Anyone who visits this URL is treated as the all-powerful Setup |
|
25
|
user, which is why the first difference exists. |
|
26
|
|
|
27
|
* “`ui`” launches a local web browser pointed at this URL. |
|
28
|
|
|
29
|
You can omit the _REPOSITORY_ argument if you run one of the above |
|
30
|
commands from within a Fossil checkout directory to serve that |
|
31
|
repository: |
|
32
|
|
|
33
|
$ fossil ui # or... |
|
34
|
$ fossil server |
|
35
|
|
|
36
|
You can abbreviate Fossil sub-commands as long as they are unambiguous. |
|
37
|
“`server`” can currently be as short as “`ser`”. |
|
38
|
|
|
39
|
You can serve a directory containing multiple `*.fossil` files like so: |
|
40
|
|
|
41
|
$ fossil server --port 9000 --repolist /path/to/repo/dir |
|
42
|
|
|
43
|
As a security precaution, when the “`server`” or |
|
44
|
“`ui`” commands are run as `root` Fossil will drop into |
|
45
|
a [chroot](../../chroot.md) with the directory where the repository is located |
|
46
|
as the new root of the filesystem. |
|
47
|
|
|
48
|
There is an [example script](/file/tools/fslsrv) in the Fossil |
|
49
|
distribution that wraps `fossil server` to produce more complicated |
|
50
|
effects. Feel free to take it, study it, and modify it to suit your |
|
51
|
local needs. |
|
52
|
|
|
53
|
See the [online documentation](/help/server) for more information on the |
|
54
|
options and arguments you can give to these commands. |
|
55
|
|
|
56
|
*[Return to the top-level Fossil server article.](../)* |
|
57
|
|