1 [[meta title="Mirroring the web site"]]
3 In keeping with the philosophy of distributed development, our web site is
4 stored in our git repositories and converted into html by
5 [ikiwiki](http://ikiwiki.info/).
7 We're mirrored on several servers. Rather than using ikiwiki's [pinger/pingee
8 approach to distribution](http://ikiwiki.info/tips/distributed_wikis/), we've
9 opted for a method that uses ssh.
11 The steps for creating a new mirror are:
13 * Add etch-backports to your /etc/apt/sources.list:
15 deb http://www.backports.org/debian etch-backports main contrib non-free
17 * Add the following lines to your /etc/apt/preferences file:
20 Pin: release a=etch-backports
24 Package: libcgi-formbuilder-perl
25 Pin: release a=etch-backports
29 Pin: release a=etch-backports
32 * Install git-core and ikiwiki
34 aptitude update; aptitutde install git-core ikiwiki
36 * Create a new user. Change the new users shell to git-shell:
38 adduser -s /usr/bin/git-shell <username>
40 * Add webmaster@george's public key to this user's ~/.ssh/authorized_keys file
42 * Add web site configuration that the user has write access to. If you are using Apache, include the following rewrite:
45 RewriteCond %{HTTP_HOST} !^(YOURHOSTNAME|web)\.monkeysphere\.info$ [NC]
46 RewriteCond %{HTTP_HOST} !^$
47 RewriteRule ^/(.*) http://web.monkeysphere.info/$1 [L,R]
49 * Upload and edit ikiwiki.setup.sample from the docs directory
51 * As the new user, create two new git repos
53 mkdir monkeysphere.git; cd monkeysphere.git; git init --bare; cd ../
54 git clone monkeysphere.git # this will create a second git repo called monkeysphere
56 * Change the mode of monkeysphere.git/hooks/post-receive to 755
58 chmod 755 monkesphere.git/hooks/post-receive
60 * Edit the file so that it executes the post-receive hook ikiwiki
61 generates (as you specified in the ikiwiki.setup file)
63 The steps to be taken on the mirror site should now be complete. The
64 following steps should be taken by a Monkeysphere admin user:
66 * Add a new dns record for SERVERNAME.monkeysphere.info.
68 * Test the ssh connection by logging in as webmaster@george.riseup.net
70 * Add the new server as a remote on
71 webmaster@george.riseup.net:monkeysphere.git
74 git add remote SERVERNAME USER@SERVERNAME.monkeysphere.info:/path/to/repo