Gentoo Archives: gentoo-doc-cvs

From: Xavier Neys <neysx@×××××××××××.org>
To: gentoo-doc-cvs@l.g.o
Subject: [gentoo-doc-cvs] cvs commit: metadoc.xml vserver-howto.xml
Date: Tue, 24 Oct 2006 12:03:15
Message-Id: 20061024120250.D7366649D8@smtp.gentoo.org
1 neysx 06/10/24 12:02:50
2
3 Modified: metadoc.xml vserver-howto.xml
4 Log:
5 #152639 vserver-howto.xml has been moved to /proj/en/vps/
6
7 Revision Changes Path
8 1.167 xml/htdocs/doc/en/metadoc.xml
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?rev=1.167&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?rev=1.167&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?r1=1.166&r2=1.167
13
14 Index: metadoc.xml
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v
17 retrieving revision 1.166
18 retrieving revision 1.167
19 diff -u -r1.166 -r1.167
20 --- metadoc.xml 9 Oct 2006 10:44:29 -0000 1.166
21 +++ metadoc.xml 24 Oct 2006 12:02:50 -0000 1.167
22 @@ -1,9 +1,9 @@
23 <?xml version='1.0' encoding="UTF-8"?>
24 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.166 2006/10/09 10:44:29 neysx Exp $ -->
25 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.167 2006/10/24 12:02:50 neysx Exp $ -->
26 <!DOCTYPE metadoc SYSTEM "/dtd/metadoc.dtd">
27
28 <metadoc lang="en">
29 -<version>1.93</version>
30 +<version>1.94</version>
31 <members>
32 <lead>neysx</lead>
33 <member>fox2mike</member>
34 @@ -356,7 +356,7 @@
35 <file id="usb-guide">/doc/en/usb-guide.xml</file>
36 <file id="liveusb">/doc/en/liveusb.xml</file>
37 <file id="fluxbox-config">/doc/en/fluxbox-config.xml</file>
38 - <file id="vserver-howto">/doc/en/vserver-howto.xml</file>
39 + <file id="vserver-howto">/proj/en/vps/vserver-howto.xml</file>
40 <file id="security-handbook-index">/doc/en/security/index.xml</file>
41 <file id="security-handbook">/doc/en/security/security-handbook.xml</file>
42 <file id="shb-chroot">/doc/en/security/shb-chroot.xml</file>
43
44
45
46 1.9 xml/htdocs/doc/en/vserver-howto.xml
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/vserver-howto.xml?rev=1.9&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/vserver-howto.xml?rev=1.9&content-type=text/plain
50 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/vserver-howto.xml?r1=1.8&r2=1.9
51
52 Index: vserver-howto.xml
53 ===================================================================
54 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/vserver-howto.xml,v
55 retrieving revision 1.8
56 retrieving revision 1.9
57 diff -u -r1.8 -r1.9
58 --- vserver-howto.xml 6 Oct 2006 21:55:24 -0000 1.8
59 +++ vserver-howto.xml 24 Oct 2006 12:02:50 -0000 1.9
60 @@ -1,8 +1,8 @@
61 <?xml version='1.0' encoding="UTF-8"?>
62 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/vserver-howto.xml,v 1.8 2006/10/06 21:55:24 nightmorph Exp $ -->
63 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/vserver-howto.xml,v 1.9 2006/10/24 12:02:50 neysx Exp $ -->
64 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
65
66 -<guide link="/doc/en/vserver-howto.xml">
67 +<guide link="/doc/en/vserver-howto.xml" redirect="/proj/en/vps/vserver-howto.xml">
68 <title>Gentoo Linux-VServer Howto</title>
69
70 <author title="Author">
71 @@ -25,421 +25,13 @@
72 <date>2006-10-06</date>
73
74 <chapter>
75 -<title>Introduction</title>
76 +<title>Moved</title>
77 <section>
78 -<title>The Linux-VServer Concept</title>
79 <body>
80
81 <p>
82 -The basic concept of the Linux-VServer solution is to separate the user-space
83 -environment into distinct units (sometimes called Virtual Private Servers) in
84 -such a way that each VPS looks and feels like a real server to the processes
85 -contained within.
86 -</p>
87 -
88 -</body>
89 -</section>
90 -<section>
91 -<title>Terms used in this Howto</title>
92 -<body>
93 -
94 -<table>
95 -<tr>
96 - <th>Term</th>
97 - <th>Description</th>
98 -</tr>
99 -<tr>
100 - <th>Linux-VServer, VServer</th>
101 - <ti>
102 - Linux-VServer is the official name of the project and used in this Howto
103 - the same way
104 - </ti>
105 -</tr>
106 -<tr>
107 - <th>virtual server, vserver, guest system</th>
108 - <ti>
109 - All these are interchangable and refer to one instance of a server (i.e.
110 - one virtual server)
111 - </ti>
112 -</tr>
113 -<tr>
114 - <th>host system, host</th>
115 - <ti>
116 - The physical machine running your Gentoo Linux will host all virtual
117 - servers
118 - </ti>
119 -</tr>
120 -<tr>
121 - <th>util-vserver</th>
122 - <ti>
123 - The <c>util-vserver</c> package contains all programs necessary for
124 - maintaining your virtual servers
125 - </ti>
126 -</tr>
127 -</table>
128 -
129 -</body>
130 -</section>
131 -</chapter>
132 -
133 -<chapter>
134 -<title>Host configuration</title>
135 -<section>
136 -<title>Install a VServer kernel</title>
137 -<body>
138 -
139 -<pre caption="Install vserver-sources">
140 -# <i>emerge vserver-sources</i>
141 -</pre>
142 -
143 -<p>
144 -After the vserver-sources are installed it's time to configure them using
145 -<c>make menuconfig</c>.
146 -</p>
147 -
148 -<pre caption="Configure vserver-sources">
149 -# <i>cd /usr/src/linux-&lt;KERNELVERSION&gt;-vserver-&lt;VSERVERVERSION&gt;</i>
150 -# <i>make menuconfig</i>
151 -
152 -Linux VServer ---&gt;
153 - [ ] Enable Legacy Kernel API
154 - [*] Disable Legacy Networking Kernel API
155 -<comment>(Highly recommended)</comment>
156 - [*] Enable Proc Security
157 - [*] Enable Hard CPU Limits
158 - Persistent Inode Context Tagging (UID24/GID24) ---&gt;
159 - [ ] Tag NFSD User Auth and Files
160 - [ ] Compile Debugging Code
161 -</pre>
162 -
163 -<note>
164 -If you are using reiserfs as filesystem on the partition where guest images are
165 -stored, you will need to enable extended attributes for reiserfs in your
166 -kernel config and additionally add the <c>attrs</c> option in
167 -<path>/etc/fstab</path>.
168 -</note>
169 -
170 -<pre caption="Configure reiserfs options">
171 -File systems --->
172 - &lt;*&gt; Reiserfs support
173 - [*] ReiserFS extended attributes
174 -</pre>
175 -
176 -<pre caption="Example fstab with extended attributes">
177 -/dev/hdb /vservers reiserfs noatime,attrs 0 0
178 -</pre>
179 -
180 -<p>
181 -After you've built and installed the kernel, update your boot loader and
182 -finally reboot to see if the kernel boots correctly.
183 -</p>
184 -
185 -<pre caption="Install the kernel">
186 -<comment>(Building the kernel)</comment>
187 -# <i>make</i>
188 -<comment>(Installing)</comment>
189 -# <i>make modules_install</i>
190 -# <i>cp arch/&lt;arch&gt;/boot/bzImage /boot/kernel-&lt;KERNELVERSION&gt;-vserver-&lt;VSERVERVERSION&gt;</i>
191 -<comment>(Edit bootloader config file as required and)</comment>
192 -# <i>reboot</i>
193 -</pre>
194 -
195 -</body>
196 -</section>
197 -<section>
198 -<title>Setup host environment</title>
199 -<body>
200 -
201 -<p>
202 -To maintain your virtual servers you need the util-vserver package which
203 -contains all necessary programs and many useful features. Be aware that there
204 -is also a package called <c>vserver-utils</c>. It is a new incarnation of the
205 -user-space implementation of the VServer kernel API, but not yet usable for
206 -production use.
207 -</p>
208 -
209 -<note>
210 -This version of the howto requires features only available in
211 -<c>&gt;=sys-cluster/util-vserver-0.30.210-r6</c>. You may have to
212 -keyword/upgrade it first.
213 -</note>
214 -
215 -<pre caption="Install util-vserver">
216 -# <i>emerge util-vserver</i>
217 -</pre>
218 -
219 -<p>
220 -You have to run the <c>vprocunhide</c> command after every reboot in order to
221 -setup <path>/proc</path> permissions correctly for vserver use. An init script
222 -has been installed by util-vserver. To use it you should add it to a runlevel:
223 -</p>
224 -
225 -<pre caption="vserver init script">
226 -# <i>rc-update add vservers default</i>
227 -# <i>/etc/init.d/vservers start</i>
228 -</pre>
229 -
230 -<note>
231 -This init script will also start your default vservers. Read below for more
232 -information.
233 -</note>
234 -
235 -<p>
236 -The vshelper script is used to restart virtual servers correctly. You
237 -have to tell the kernel where the vshelper script is located:
238 -</p>
239 -
240 -<pre caption="vshelper setup">
241 -# <i>echo 'kernel.vshelper = /usr/lib/util-vserver/vshelper' &gt;&gt; /etc/sysctl.conf</i>
242 -# <i>sysctl -p</i>
243 -</pre>
244 -
245 -</body>
246 -</section>
247 -</chapter>
248 -
249 -<chapter>
250 -<title>Creating a guest template</title>
251 -<section>
252 -<title>Install a vserver stage3</title>
253 -<body>
254 -
255 -<p>
256 -You have to download a vserver prepared stage3 from one of
257 -<uri link="/main/en/mirrors.xml">our mirrors</uri>. Those stages are located
258 -under the <path>experimental/&lt;arch&gt;/vserver/</path> directory.
259 -Then use the <c>vserver-new</c> script to create the initial guest.
260 -</p>
261 -
262 -<p>
263 -You have to choose a context ID for your vserver (dynamic context IDs are
264 -discouraged) as well as the necessary network device information (In this
265 -example eth0 is configured with 192.168.1.253/24 and the context ID is
266 -equivalent to the last two parts of the virtual servers IP).
267 -</p>
268 -
269 -<pre caption="Start stage3 installation">
270 -# <i>vserver-new gentoo-template \</i>
271 - <i>--hostname gentoo \</i>
272 - <i>--context 1253 \</i>
273 - <i>--interface eth0:192.168.1.253/24 \</i>
274 - <i>stage3 /path/to/stage3-&lt;arch&gt;-&lt;date&gt;.tar.bz2 &lt;arch&gt;</i>
275 -</pre>
276 -
277 -<note>
278 -To reflect your network settings you should change
279 -<path>/etc/conf.d/hostname</path>, <path>/etc/conf.d/domainname</path> and
280 -<path>/etc/hosts</path> inside the guest to your needs. See <uri
281 -link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=8#doc_chap2_sect1">chapter
282 -8.b.1</uri> and <uri
283 -link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=8#doc_chap2_sect4">chapter
284 -8.b.4</uri>. The rest of your virtual servers network setup will be
285 -done on the host.
286 -</note>
287 -
288 -</body>
289 -</section>
290 -<section>
291 -<title>Create the template tarball</title>
292 -<body>
293 -
294 -<p>
295 -You don't have to build a stage3 tarball for every guest. The <c>vserver-new</c>
296 -script supports templates. In order to use them you have to create a tarball of
297 -your vserver installation:
298 -</p>
299 -
300 -<pre caption="Create template tarball">
301 -# <i>cd /vservers/gentoo-template</i>
302 -# <i>tar cjvpf ../gentoo-template-&lt;arch&gt;-&lt;date&gt;.tar.bz2 ./</i>
303 -</pre>
304 -
305 -<p>
306 -To create a new guest using this tarball just use <c>vserver-new</c>:
307 -</p>
308 -
309 -<pre caption="Use template tarball">
310 -# <i>cd /vservers</i>
311 -# <i>vserver-new myguest \</i>
312 - <i>--hostname myguest \</i>
313 - <i>--context 1252 \</i>
314 - <i>--interface eth0:192.168.1.252/24 \</i>
315 - <i>template ./gentoo-template-&lt;arch&gt;-&lt;date&gt;.tar.bz2 &lt;arch&gt;</i>
316 -</pre>
317 -
318 -<note>
319 -You should use a shared portage tree to keep guests small in size. Edit
320 -<path>/etc/vservers/myguest/fstab</path> and uncomment the entries
321 -for <path>/usr/portage</path> and <path>/usr/portage/distfiles</path>. Guests
322 -will have read-only access to <path>/usr/portage</path> and read-write access
323 -to <path>/usr/portage/distfiles</path>.
324 -</note>
325 -
326 -</body>
327 -</section>
328 -<section>
329 -<title>Test the virtual server</title>
330 -<body>
331 -
332 -<p>
333 -You should be able to start and enter the vserver by using the commands below.
334 -If you miss commands like <c>mount</c> or <c>dmesg</c> you should <c>emerge
335 -util-linux</c> inside your virtual server as the vserver profile doesn't ship
336 -this package by default.
337 -</p>
338 -
339 -<pre caption="Test the virtual server">
340 -# <i>vserver myguest start</i>
341 -# <i>vserver-stat</i>
342 -CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME
343 -0 90 1.4G 153.4K 14m00s11 6m45s17 2h59m59 root server
344 -1252 2 3M 286 0m00s45 0m00s42 0m02s91 myguest
345 -# <i>vserver myguest enter</i>
346 -# <i>ps ax</i>
347 -PID TTY STAT TIME COMMAND
348 - 1 ? S 0:00 init [3]
349 -22887 ? Ss 0:00 /usr/sbin/syslog-ng
350 -20496 pts/0 S 0:00 /bin/bash -login
351 -20508 pts/0 R+ 0:00 ps ax
352 -# <i>logout</i>
353 -</pre>
354 -
355 -</body>
356 -</section>
357 -</chapter>
358 -
359 -<chapter>
360 -<title>Maintenance made easy</title>
361 -<section>
362 -<title>Start guests on boot</title>
363 -<body>
364 -
365 -<p>
366 -You can start certain guests during boot. Each guest can be assigned a MARK.
367 -Now everything you have to do is configure these MARKs in the guests
368 -configuration and tell the init script to run all MARKed guests.
369 -</p>
370 -
371 -<pre caption="Configure MARKs for each guest">
372 -<comment>(Do this for every guest you want to start)</comment>
373 -# <i>mkdir -p /etc/vservers/myguest/apps/init</i>
374 -# <i>echo "default" > /etc/vservers/myguest/apps/init/mark</i>
375 -</pre>
376 -
377 -<note>
378 -Since all guests marked with "default" are started by default, nothing more has
379 -to be done. If you have different marks you should also update
380 -<path>/etc/conf.d/vservers</path>.
381 -</note>
382 -
383 -</body>
384 -</section>
385 -<section>
386 -<title>Gentoo goodies</title>
387 -<body>
388 -
389 -<p>
390 -The util-vserver ebuild has installed some goodies for Gentoo guests. You know
391 -<c>vserver-new</c> from the previous chapter. In this chapter, you will learn
392 -how to use <c>vesync</c> and <c>vemerge</c> to keep portage in sync as well as
393 -<c>vupdateworld</c> and <c>vdispatch-conf</c> to update guests.
394 -</p>
395 -
396 -</body>
397 -</section>
398 -<section>
399 -<title>Keep portage in sync</title>
400 -<body>
401 -
402 -<p>
403 -The script <c>vesync</c> will help you to keep the metadata cache and overlays
404 -in sync. <c>vemerge</c> is a simple wrapper for <c>emerge</c> in guests.
405 -</p>
406 -
407 -<pre caption="Examples">
408 -<comment>(Sync metadata for 'myguest')</comment>
409 -# <i>vesync myguest</i>
410 -<comment>(Sync metadata for all guests)</comment>
411 -# <i>vesync -a</i>
412 -<comment>(Sync metadata for all guests except 'myguest')</comment>
413 -# <i>vesync -a -e myguest</i>
414 -<comment>(Sync 'myoverlay' for all guests)</comment>
415 -# <i>vesync -a \</i>
416 - <i>--overlay /usr/local/overlays/myoverlay \</i>
417 - <i>--overlay-host rsync://rsync.myhost.com/myoverlay \</i>
418 - <i>--overlay-only</i>
419 -<comment>(emerge app-editors/vim in 'myguest')</comment>
420 -# <i>vemerge myguest app-editors/vim -va</i>
421 -</pre>
422 -
423 -<note>
424 -This script requires you to have a shared portage tree.
425 -</note>
426 -
427 -</body>
428 -</section>
429 -<section>
430 -<title>Update guests</title>
431 -<body>
432 -
433 -<p>
434 -Gentoo guests can share packages to save compilation time. In order to use
435 -shared packages, you have to create a central directory for packages on the
436 -host. We will use <path>/var/cache/vpackages</path> on the host and mount it
437 -to <path>/usr/portage/packages</path> in every guest.
438 -</p>
439 -
440 -<pre caption="Add bind mount to guest configuration">
441 -# <i>mkdir -p /var/cache/vpackages</i>
442 -# <i>$EDITOR /etc/vservers/myguest/fstab</i>
443 -<comment>(Add this line at the end)</comment>
444 -/var/cache/vpackages /usr/portage/packages none bind,rw 0 0
445 -</pre>
446 -
447 -<p>
448 -Now you can use <c>vupdateworld</c> to update every guest. The command is
449 -equivalent to something like <c>emerge --deep --update --newuse world</c>
450 -depending on command line options.
451 -</p>
452 -
453 -<pre caption="vupdateworld examples">
454 -<comment>(Pretend update for 'myguest')</comment>
455 -# <i>vupdateworld -p myguest</i>
456 -<comment>(Update 'myguest' using binary packages)</comment>
457 -# <i>vupdateworld -k myguest</i>
458 -<comment>(Update all guests using binary packages)</comment>
459 -# <i>vupdateworld -ka</i>
460 -</pre>
461 -
462 -<note>
463 -In order to get binary packages you can either use PORTAGE_BINHOST (see <c>man
464 -make.conf</c>) or set FEATURES="buildpkg" in one or more guests.
465 -</note>
466 -
467 -<p>
468 -After a successful update you can easily update all configuration files with
469 -<c>vdispatch-conf</c>. It is a simple wrapper for <c>dispatch-conf</c> and
470 -behaves exactly the same.
471 -</p>
472 -
473 -<pre caption="vdispatch-conf examples">
474 -<comment>(Update configuration files for 'myguest')</comment>
475 -# <i>vdispatch-conf myguest</i>
476 -<comment>(Update configuration files for all guests)</comment>
477 -# <i>vdispatch-conf -a</i>
478 -</pre>
479 -
480 -</body>
481 -</section>
482 -
483 -<section>
484 -<title>Contact</title>
485 -<body>
486 -
487 -<p>
488 -Please feel free to contact the <mail link="hollow@g.o">author</mail> or
489 -file a bug on <uri link="http://bugs.gentoo.org">Bugzilla</uri> in case of any
490 -problems.
491 +This document has been moved to a <uri
492 +link="/proj/en/vps/vserver-howto.xml">new location</uri>.
493 </p>
494
495 </body>
496
497
498
499 --
500 gentoo-doc-cvs@g.o mailing list