fixing formatting and typo (pusch -> push).
[monkeysphere.git] / website / mirrors.mdwn
1 [[meta title="Mirroring the web site"]]
2
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/).
6
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.
10
11 The steps for creating a new mirror are:
12
13  * Add etch-backports to your /etc/apt/sources.list:
14                 deb http://www.backports.org/debian etch-backports main contrib non-free
15  * Add the following lines to your /etc/apt/preferences file:
16                 Package: ikiwiki
17                 Pin: release a=etch-backports
18                 Pin-Priority: 999
19
20                 # needed by ikiwiki
21                 Package: libcgi-formbuilder-perl
22                 Pin: release a=etch-backports
23                 Pin-Priority: 999
24                 
25                 Package: git-core 
26                 Pin: release a=etch-backports
27                 Pin-Priority: 999
28         * Install git-core and ikiwiki
29
30                 aptitude update; aptitutde install git-core ikiwiki
31
32         * Create a new user. Change the new users shell to git-shell:
33
34                 adduser -s /usr/bin/git-shell <username>
35
36         * Add webmaster@george's public key to this user's ~/.ssh/authorized_keys file
37
38         * Add web site configuration that the user has write access to. If you are using Apache, include the following rewrite:
39
40                 RewriteEngine On
41                 RewriteCond %{HTTP_HOST} !^(YOURHOSTNAME|web)\.monkeysphere\.info$ [NC]
42                 RewriteCond %{HTTP_HOST} !^$
43                 RewriteRule ^/(.*) http://web.monkeysphere.info/$1 [L,R]
44
45         * Upload and edit ikiwiki.setup.sample from the docs directory
46         * As the new user, create two new git repos
47
48                 mkdir monkeysphere.git; cd monkeysphere.git; git init --bare; cd ../
49                 git clone monkeysphere.git # this will create a second git repo called monkeysphere
50
51         * Change the mode of monkeysphere.git/hooks/post-receive to 755
52
53                 chmod 755 monkesphere.git/hooks/post-receive
54
55         * Edit the file so that it executes the post-receive hook ikiwiki generates (as you specified in the ikiwiki.setup file)
56
57 The steps to be taken on the mirror site should now be complete. The following steps should be taken by a Monkeysphere admin user:
58
59  * Add a new dns record for SERVERNAME.monkeysphere.info. 
60  * Test the ssh connection by logging in as webmaster@george.riseup.net
61  * Add the new server as a remote on webmaster@george.riseup.net:monkeysphere.git
62
63                 cd ~/monkeysphere.git
64                 git add remote SERVERNAME USER@SERVERNAME.monkeysphere.info:/path/to/repo
65
66  * Test:
67
68                 git push SERVERNAME
69
70
71