Index: www/aboutcgi.wiki ================================================================== --- www/aboutcgi.wiki +++ www/aboutcgi.wiki @@ -2,11 +2,11 @@

Introduction

CGI or "Common Gateway Interface" is a venerable yet reliable technique for generating dynamic web content. This article gives a quick background on how CGI works and describes how Fossil can act as a CGI service.

This is a "how it works" guide. If you just want to set up Fossil -as a CGI server, see the [./server.wiki | Fossil Server Setup] page. +as a CGI server, see the [./server/ | Fossil Server Setup] page.

A Quick Review Of CGI

An HTTP request is a block of text that is sent by a client application (usually a web browser) and arrives at the web server over a network Index: www/alerts.md ================================================================== --- www/alerts.md +++ www/alerts.md @@ -12,11 +12,11 @@ * Announcements Subscribers can elect to receive emails as soon as these events happen, or they can receive a daily digest of the events instead. -Email alerts are sent by a [Fossil server](./server.wiki), which must be +Email alerts are sent by a [Fossil server](./server/), which must be [set up](#quick) by the Fossil administrator to send email. Email alerts do not currently work if you are only using Fossil from the command line. Index: www/antibot.wiki ================================================================== --- www/antibot.wiki +++ www/antibot.wiki @@ -130,11 +130,11 @@ These two sub-settings can be used separately or together. If used together, then the delay timer does not start until after the first mouse movement is detected. -See also [./server.wiki#loadmgmt|Managing Server Load] for a description +See also [./loadmgmt.md|Managing Server Load] for a description of how expensive pages can be disabled when the server is under heavy load.

The ongoing struggle

Index: www/backoffice.md ================================================================== --- www/backoffice.md +++ www/backoffice.md @@ -9,11 +9,11 @@ What Is The Backoffice ---------------------- The backoffice is a mechanism used by a -[Fossil server](/doc/trunk/www/server.wiki) to do low-priority +[Fossil server](./server/) to do low-priority background work that is not directly related to the user interface. Here are some examples of the kinds of work that backoffice performs: 1. Sending email alerts and notifications 2. Sending out daily digests of email notifications @@ -39,12 +39,12 @@ server for "[fossil sync](/help?cmd=sync)" and [fossil clone](/help?cmd=clone)" commands which are implemented as web requests - albeit requests that the human user never sees. Web requests can arrive at the Fossil server via direct TCP/IP (for example when Fossil is started using commands like "[fossil server](/help?cmd=server)") -or via [CGI](/doc/trunk/www/server.wiki) or -[SCGI](/doc/trunk/www/scgi.wiki) or via SSH. +or via [CGI](./server/any/cgi.md) or +[SCGI](./server/any/scgi.md) or via SSH. A backoffice process might be started regardless of the origin of the request. The backoffice is not a daemon. Each backoffice process runs for a short while and then exits. This helps keep Fossil easy to manage, since there Index: www/cgi.wiki ================================================================== --- www/cgi.wiki +++ www/cgi.wiki @@ -7,13 +7,13 @@ a common point of rendezvous for syncing, and by providing a web-based portal where developers and non-developers alike can learn about the project and its current state. Setting up a server using Fossil is easy. -A [./server.wiki|separate document] talks about four different methods for -setting up a Fossil server. One of those methods, and perhaps the most -popular is [./server.wiki#cgi|CGI]. CGI is the technique that the three +A [./server/|separate document] talks about all of the many different methods for +setting up a Fossil server, one of which is [./server/any/cgi.md | as a CGI +script]. CGI is the technique that the three [./selfhost.wiki|self-hosting Fossil repositories] all use. Setting up a Fossil server using CGI is mostly about writing a short script (usually just 2 lines line) in the cgi-bin folder of an ordinary web-browser. But there are a lot of extra options that can be added Index: www/changes.wiki ================================================================== --- www/changes.wiki +++ www/changes.wiki @@ -13,11 +13,11 @@ * Add support for fenced code blocks and improved hyperlink processing to the [/md_rules|markdown formatter]. * Enhance the [/help?cmd=/stat|/stat] page so that it gives the option to show a breakdown of forum posts. * Change the default [./hashpolicy.wiki|hash policy] to SHA3. - * Timeout [./server.wiki#cgi|CGI requests] after 300 seconds, or + * Timeout [./server/any/cgi.md|CGI requests] after 300 seconds, or some other value set by the [./cgi.wiki#timeout|"timeout:" property] in the CGI script. * Documentation improvements ADDED www/chroot.md Index: www/chroot.md ================================================================== --- /dev/null +++ www/chroot.md @@ -0,0 +1,41 @@ +# The Server Chroot Jail + +If you run Fossil as root in any mode that [serves data on the +network][srv], and you're running it on Unix or a compatible OS, Fossil +will drop itself into a [`chroot(2)` jail][cj] shortly after starting +up, once it's done everything that requires root access. Most commonly, +you run Fossil as root to allow it to bind to TCP port 80 for HTTP +service, since normal users are restricted to ports 1024 and up on OSes +where this behavior occurs. + +Fossil uses the owner of the Fossil repository file as its new user +ID when dropping root privileges. + +When this happens, Fossil needs to have all of its dependencies inside +the chroot jail in order to continue work. There are several things you +typically need in order to make things work properly: + +* the repository file(s) + +* `/dev/null` — create it with `mknod(8)` inside the jail directory + ([Linux example][mnl]) + +* `/dev/urandom` — ditto + +* `/proc` — you might need to mount this virtual filesystem inside the + jail on Linux systems that make use of [Fossil’s server load + shedding feature][fls] + +* any shared libraries your `fossil` binary is linked to, unless you + [configured Fossil with `--static`][bld] to avoid it + +Fossil does all of this in order to protect the host OS. You can make it +bypass the jail part of this by passing --nojail to fossil server, +but you cannot make it skip the dropping of root privileges, on purpose. + + +[bld]: https://www.fossil-scm.org/fossil/doc/trunk/www/build.wiki +[cj]: https://en.wikipedia.org/wiki/Chroot +[fls]: ./loadmgmt.md +[mnl]: https://fossil-scm.org/forum/forumpost/90caff30cb +[srv]: ./server/ Index: www/concepts.wiki ================================================================== --- www/concepts.wiki +++ www/concepts.wiki @@ -423,11 +423,11 @@
  • Inetd or Stunnel. Configure programs like inetd, xinetd, or stunnel to hand off HTTP requests directly to the [/help?cmd=http|fossil http] command. -See the [./server.wiki | How To Configure A Fossil Server] document +See the [./server/ | How To Configure A Fossil Server] document for details.

    6.0 Review Of Key Concepts