+## Overview
+
+There are several possible level of decentralisation:
+
+ 0. [[default setup|rcs/git]], no decentralisation
+ 1. [[a simple HTML mirror|tips/Git_repository_and_web_server_on_different_hosts/]]
+ 2. [[separate ikiwiki and git servers|tips/Hosting_Ikiwiki_and_master_git_repository_on_different_machines]]
+ 3. separate `srcdir`, still requires a central bare repo - uses [[plugins/pinger]]
+ 4. completely distinct ikiwiki installs, synchronised with [[plugins/contrib/gitpush]]
+
+Here's a graphic overview of those:
+
+### Default setup - one central server
+
+[[!img rcs/git/wiki_edit_flow.svg size=400x]]
+
+In the default setup, all the resources are stored on the central
+servers. Users can still clone and edit the git repo by hand and
+contribute by git, but otherwise all the changes happen on a single
+web interface. This basic setup is best described in [[rcs/git]].
+
+### Separate webserver and git repository
+
+[[!img tips/Git_repository_and_web_server_on_different_hosts/separate-webserver.svg size=400x]]
+
+This is the configuration described in
+[[tips/Git_repository_and_web_server_on_different_hosts]]. The webserver part
+hosts the HTML files, the ikiwiki [[cgi]] but everything else is on
+the git server.
+
+### Separate webserver and git repository, the git srcdir being hosted on the webserver
+
+[[!img Hosting_Ikiwiki_and_master_git_repository_on_different_machines/separate-web-git-servers.svg size=400x]]
+
+This is the configuration described in
+[[tips/Hosting_Ikiwiki_and_master_git_repository_on_different_machines]]. One server hosts the web server (and the [[Ikiwiki cgi|cgi]]) and the git source dir; a second server hosts the git bare repository. This can be used when you have very limited access to the git server.
+
+### Decentralised pinger setup
+
+[[!img ping-setup.svg size=400x]]
+
+In this configuration, the mirrors all have their own `srcdir`, but
+still need to push and pull from the same central bare git repo. The
+[[plugins/pinger]] plugin is used to ping the mirrors from the central
+server on edits.
+
+Step by step setup instructions for this are detailed below.
+
+### Fully decentralised setup
+
+[[!img decentralized_wikis.svg size=400x]]
+
+In this configuration, each wiki is fully independent and pushes its
+changes to other wikis using the [[plugins/contrib/gitpush]] plugin.
+
+## Step by step setup instructions
+
+The first two ways of setting up ikiwiki are better described in [[setup]] or [[tips/Git_repository_and_web_server_on_different_hosts]]. The remainder of this page describes the latter two more complex distributed setups.
+
+Say you have a friend that has already configured a shiny ikiwiki site, and you want to help by creating a mirror. You still need to figure out how to install ikiwiki and everything, hopefully this section will help you with that.
+
+Note that parts of the following documentation duplicate instructions from [[setup]], [[setup/byhand]], [[rcs/git]] and [[tips/laptop_wiki_with_git]].
+
+### Installing ikiwiki
+
+You need to install the ikiwiki package for the mirror to work. You can use ikiwiki to publish the actual HTML pages elsewhere if you don't plan on letting people edit the wiki, but generally you want the package to be installed on the webserver for editing to work.
+
+ apt-get install ikiwiki
+
+### Setting up the wiki
+
+(!) Optionnally: create a user just for this wiki. Otherwise the wiki will run as your user from here on.
+
+We assume your username is `user` and that you will host the wiki under the hostname `mirror.example.com`. The original wiki is at `wiki.example.com`. We also assume that your friend was nice enough to provide a copy of the `.setup` file in the `setup` branch, which is the case for any wiki hosted on [branchable.com](http://branchable.com).
+
+ cd ~user
+ # setup srcdir, named source
+ git clone git://wiki.example.com/ source
+ # convenience copy of the setup file
+ git clone -b origin/setup source setup
+ cd setup
+ edit ikiwiki.setup # adapt configuration
+
+When editing ikiwiki.setup, make sure you change the following entries:
+
+ cgiurl: http://mirror.example.com/ikiwiki.cgi
+ cgi_wrapper: /var/www/ikiwiki.cgi
+ srcdir: /home/user/source
+ destdir: /var/www/mirror.example.com
+ libdir: /home/user/source/.ikiwiki
+ git_wrapper: /home/user/source/.git/hooks/post-commit
+ git_test_receive_wrapper: /home/user/source/.git/hooks/pre-receive
+ ENV:
+ TMPDIR: /home/user/tmp
+
+This assumes that your /var/www directory is writable by your user.
+
+### Basic HTML rendering
+
+You should already be able to make a plain HTML rendering of the wiki:
+
+ ikiwiki --setup ikiwiki.setup
+
+### Webserver configuration
+
+You will also need a webserver to serve the content in the `destdir`
+defined above. We assume you will configure a virtual host named `mirror.example.com`. Here are some examples on how to do those, see [[!iki setup]] and [[!iki tips/dot_cgi]] for complete documentation.
+
+Note that this will also configure CGI so that people can edit the wiki. Note that this configuration may involve timeouts if the main site is down, as ikiwiki will attempt to push to the central git repository at every change.
+
+#### Apache configuration
+
+ <VirtualHost *:80>
+ ServerName mirror.example.com:80
+ DocumentRoot /var/www/mirror.example.com
+ <Directory /var/www/mirror.example.com>
+ Options Indexes MultiViews ExecCGI
+ AllowOverride None
+ Order allow,deny
+ allow from all
+ </Directory>
+ ScriptAlias /ikiwiki.cgi /var/www/ikiwiki.cgi
+ ErrorDocument 404 "/ikiwiki.cgi"
+ </VirtualHost>
+
+#### Nginx configuration
+
+ server {
+ root /var/www/mirror.example.com/;
+ index index.html index.htm;
+ server_name mirror.example.com;
+
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+ location /ikiwiki.cgi {
+ fastcgi_pass unix:/tmp/fcgi.socket;
+ fastcgi_index ikiwiki.cgi;
+ fastcgi_param SCRIPT_FILENAME /var/www/ikiwiki.cgi;
+ fastcgi_param DOCUMENT_ROOT /var/www/mirror.example.com;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+Start this process as your own user (or the user that has write access
+to `srcdir`, `destdir`, etc):
+
+ spawn-fcgi -s /tmp/fcgi.socket -n -- /usr/sbin/fcgiwrap
+
+Make this writable:
+
+ chmod a+w /tmp/fcgi.socket
+
+### Enable the pinger functionality
+
+At this point, you need to enable the pinger functionality to make sure that changes on the central server propagate to your mirror.
+
+This assumes a central wiki that exposes its git
+repository and has the [[plugins/pinger]] plugin enabled. Enable the
+[[plugins/pingee]] plugin in your configuration, and edit the origin wiki,