updating mirrors help file to reflect new rsync approach.
[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 simpler rsync of the ikiwiki-produced html files. 
10
11 ## Initial steps to take on the mirror server ##
12
13 Create a new user. 
14
15 Add web site configuration that the user has write access to. If you are
16 using Apache, include the following rewrite:
17
18     RewriteEngine On
19     RewriteCond %{HTTP_HOST} !^(YOURHOSTNAME|web)\.monkeysphere\.info$ [NC]
20     RewriteCond %{HTTP_HOST} !^$
21     RewriteRule ^/(.*) http://web.monkeysphere.info/$1 [L,R]
22
23 Add webmaster@george's public key to this user's ~/.ssh/authorized_keys
24 file, restricting that user to rsync (modify path to web directory as
25 needed):
26
27     command="/usr/bin/rsync --server -vlogDtprz --delete . web/",no-pty,no-agent-forwarding,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0SCD6tAh7g1yyuelIm5zyh5OFX89NNbpNzyp+BxXNxMc/C1BS9SN5KlNDT30WdDbw3X0St0dBBC69TZWYbSUn4+/6BNmYpLH2orhedBv4w2jBLmtVEfnMWa3a11CnIagMEkEz7rBIWpl76WOqzoueQbAAa/7GziVmv+2qdjcDFxHluO+VL/+gEw8BqZc587oiDYkIw3oBnOLaxUWDtaMFKiL8sgdBmPxzc8PgHxL5ezVDJExw5krR4FK7hG7KpBOlSwKQPFy2pPhHSb1ZuFJmp2kr2wfJ0RO7By5s/GbrkJbnGoiJ5W0fUC9YoI82U3svC5saowvoSo19yToJW4QUw== webmaster@george
28
29
30 ## Admin steps to take to enable the configuration ##
31
32 Add a new dns record for SERVERNAME.monkeysphere.info. 
33
34 If the mirror server is not participating in the monkeysphere, add the
35 server to webmaster's known host file.
36
37 Add the new server to ~/mirrors file on george in the format:
38
39     username@server:directory
40
41 Test by manually running the git post-receive hook:
42
43     ~monkeysphere.git/hooks/post-receive
44
45
46