annotate DOCS/tech/mirrors/mirror_howto.txt @ 18725:5db2de837b06

misc corrections
author diego
date Fri, 16 Jun 2006 11:17:04 +0000
parents abaac3427f7c
children 7262fa28d79f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
1 ------------------------------
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
2 How to build an MPlayer mirror
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
3 ------------------------------
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
4
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
5 =======================================================================
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
6 WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
7 -----------------------------------------------------------------------
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
8 This is a preliminary version. Do not rely on anything here.
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
9 Please send feedback + corrections to the mplayer-mirror mailing list.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
10 =======================================================================
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
11
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
12 About this document
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
13 ~~~~~~~~~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
14
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
15 Mirroring MPlayer is quite easy but requires a few steps to be taken
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
16 and a few things taken care of. This document describes these steps
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
17 in detail so that anyone wishing to build an official or an unofficial
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
18 mirror can do that without much trouble.
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
19
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
20
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
21
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
22 A note on performance issues
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
23 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
24
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
25 A few of the commands used here will generate some load on our main server.
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
26 Too many clients executing them at once will overload our server and cause
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
27 a performance degradation for all our users. Thus we kindly ask you to be
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
28 considerate about what you do. We do not want to restrict mirroring to a
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
29 few select people, but this requires everyone using the system described
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
30 here to behave.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
31
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
32
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
33 Outline of the mirroring system
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
34 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
35
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
36 The mirroring system uses rsync to transfer the data and to perform
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
37 updates. A script (update_mplayer_rsync) is provided to call the rsync
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
38 client with the right set of parameters. This script should be run
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
39 periodically via cron.
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
40 Additionally, official mirrors should set up an ssh account so that
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
41 updates can be triggered when important changes on the main server
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
42 are performed.
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
43 Mirrors should provide their data over HTTP or FTP or both. Each official
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
44 mirror will be assigned a mirror number (wwwXXX.mplayerhq.hu or
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
45 ftpXXX.mplayerhq.hu where XXX is the mirror number). This mirror
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
46 number determines the hostname over which it will be reached.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
47
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
48
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
49 Getting the data, mirroring script and cron setup
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
50 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
51
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
52 The mirroring script is located in our Subversion repository at
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
53
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
54 svn://svn.mplayerhq.hu/mplayer/trunk/DOCS/tech/mirrors/update_mplayer_rsync
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
55
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
56 or on the web at
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
57
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
58 http://svn.mplayerhq.hu/*checkout*/mplayer/trunk/DOCS/tech/mirrors/update_mplayer_rsync
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
59
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
60 This script requires a working `rsync` client. The handling of the
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
61 lock file is done by using `lockfile` from the procmail package.
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
62 Using a lock file is recommended but not necessary. The temporary file
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
63 generation is handled by `mktemp` which is available from
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
64 http://www.mktemp.org/mktemp/ .
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
65
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
66 The script contains a few configuration variables at the begining that
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
67 can and should be set:
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
68 PATH: The $PATH to be used within the script (recommended).
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
69 LOCK: The full path to the lock file to be used (/var/lock/mplayer-mirror-lock
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
70 or something similar, recommended).
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
71 MIRROR_ROOT: The root of the mirror. This is the directory where all files
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
72 are downloaded to (required).
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
73 MAILADR: The mail address where reports should be sent to (required).
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
74 TMPDIR: The directory where temporary files should be created.
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
75 If you set this explicitly, you have to uncomment the export below
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
76 (defaults to /tmp if not set).
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
77
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
78 Install this script and set the variables according to your setup. Then run
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
79 it once to get the first checkout of the mirror. This will require (at the
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
80 time of this writing - 2006-06) about 500MB of disk space.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
81 You should get two directories in your $MIRROR_ROOT: homepage and MPlayer.
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
82 The former containing the HTML pages for the mirror and the latter the
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
83 downloadable files.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
84
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
85 If this worked out OK, you should set up a cron job that periodically updates
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
86 the files. If you run an official mirror you should run the script every
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
87 6h to 12h (6h recommended). If you do not run an official mirror, you should
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
88 not run the script more often than once a day. Please use an "odd" time
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
89 to run the script when it is unlikely that any other cron job is running.
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
90 Bad times are e.g. full hours, or minutes that are divisible by 5.
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
91 An example crontab line would look like this:
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
92 ---
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
93 17 1,8,13,19 * * * /path/to/update_mplayer_rsync
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
94 ---
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
95 (please change the minute and hours to something random)
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
96
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
97 You can change the rest of the script as you see fit, although it is not
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
98 recommended. Please DO NOT CHANGE the options of the rsync commands.
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
99 Especially DO NOT REMOVE the -t and -W options. These prevent calculating
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
100 checksums on the server side which are very expensive.
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
101
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
102
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
103 Setting up an SSH account for update triggers
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
104 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
105
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
106 Official mirrors should provide an ssh-based trigger to run the update script
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
107 on request. This makes it possible to distribute releases and other important
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
108 files immediately to all mirrors.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
109
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
110 The setup does not need a special user other than the one as which the update
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
111 script is run and does not allow running any other command.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
112
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
113 First you need to create an ssh key pair by running:
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
114 ---
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
115 ssh-keygen -t dsa -C MPHQ_rsync_trigger -f www#_sshkey
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
116 ---
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
117 (replace the '#' by your mirror number)
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
118
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
119 You should send the private key to us by mail and specify the host and
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
120 user to be used. Please use a private mail of one of the admins and
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
121 DO NOT send the private key to the mirror mailing list.
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
122
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
123 The public key should be placed in the ~/.ssh/authorized_keys file of the
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
124 user running the updates. To restrict the ssh key to only one command place
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
125 the following directives at the begining of the line with the key:
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
126 from="*.mplayerhq.hu",command="<path_to_update_mplayer_rsync>"
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
127 e.g.:
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
128 ---
18725
5db2de837b06 misc corrections
diego
parents: 18674
diff changeset
129 from="*.mplayerhq.hu",command="/path/to/update_mplayer_rsync" ssh-dss AAAA
18674
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
130 B3NzaC1kc3MAAAEBAI20yhE3/bRjzojUhhMz4DHnGhcJUiPWOfoP9CygnFOYOxJTFlxgqM3iJiHWRxgK
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
131 FJ/Uw40eV9K4Ww4fp2pe1guXJzKna8+6vBXaPPVEVxSyaxgtt4Xt3zpUuCnNljgArcEhwcNyOyH2RVln
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
132 yhyxsrKhuq5ZoNHD3caBGjZu3eOR2atPGS1NOdeN/hytIoh8T8DicPqPI29yWX9yAjnHv6wdPutwMLu6
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
133 [...]
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
134 n0Fs3CJY6/1UpgDGH7VPey0SdpJEDewltRLA+buP++2vJD/NUOeGzcRydo2NdZ1wiiaytXxkaec928JC
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
135 NABTeBh6NKAg4vnPvcRLKEBVdSrar/fARSbOmf3HOcsw3uZoAIE9jDGhnMKcnXfHjPZ2tZP9CHs6Wo4n
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
136 yDOxIfDZmJ7VJqMRc6//p5k81pkkGvawbPA63StI/Dkv/648l4XONuJc2z5gaUdjrTA8TsD/VJGiGcHl
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
137 mlGj3IWCBz7e4+XB3L64kFZwLCYN8kwDUAaHq4EtcMVOnQ== MPHQ_rsync_trigger
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
138 ---
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
139 (lines split for readability)
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
140
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
141
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
142 Setting up a webserver
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
143 ~~~~~~~~~~~~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
144
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
145 TO BE DONE
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
146
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
147
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
148 Setting up an FTP server
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
149 ~~~~~~~~~~~~~~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
150
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
151 TO BE DONE
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
152
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
153
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
154 Mailinglist
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
155 ~~~~~~~~~~~
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
156
abaac3427f7c Preliminary version of mirror howto
attila
parents:
diff changeset
157 TO BE DONE