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