neysx 06/10/24 12:02:50 Modified: metadoc.xml vserver-howto.xml Log: #152639 vserver-howto.xml has been moved to /proj/en/vps/
Revision Changes Path 1.167 xml/htdocs/doc/en/metadoc.xml file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?rev=1.167&view=markup plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?rev=1.167&content-type=text/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?r1=1.166&r2=1.167 Index: metadoc.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v retrieving revision 1.166 retrieving revision 1.167 diff -u -r1.166 -r1.167 --- metadoc.xml 9 Oct 2006 10:44:29 -0000 1.166 +++ metadoc.xml 24 Oct 2006 12:02:50 -0000 1.167 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding="UTF-8"?> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.166 2006/10/09 10:44:29 neysx Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.167 2006/10/24 12:02:50 neysx Exp $ --> <!DOCTYPE metadoc SYSTEM "/dtd/metadoc.dtd"> <metadoc lang="en"> -<version>1.93</version> +<version>1.94</version> <members> <lead>neysx</lead> <member>fox2mike</member> @@ -356,7 +356,7 @@ <file id="usb-guide">/doc/en/usb-guide.xml</file> <file id="liveusb">/doc/en/liveusb.xml</file> <file id="fluxbox-config">/doc/en/fluxbox-config.xml</file> - <file id="vserver-howto">/doc/en/vserver-howto.xml</file> + <file id="vserver-howto">/proj/en/vps/vserver-howto.xml</file> <file id="security-handbook-index">/doc/en/security/index.xml</file> <file id="security-handbook">/doc/en/security/security-handbook.xml</file> <file id="shb-chroot">/doc/en/security/shb-chroot.xml</file> 1.9 xml/htdocs/doc/en/vserver-howto.xml file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/vserver-howto.xml?rev=1.9&view=markup plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/vserver-howto.xml?rev=1.9&content-type=text/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/vserver-howto.xml?r1=1.8&r2=1.9 Index: vserver-howto.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/vserver-howto.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- vserver-howto.xml 6 Oct 2006 21:55:24 -0000 1.8 +++ vserver-howto.xml 24 Oct 2006 12:02:50 -0000 1.9 @@ -1,8 +1,8 @@ <?xml version='1.0' encoding="UTF-8"?> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/vserver-howto.xml,v 1.8 2006/10/06 21:55:24 nightmorph Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/vserver-howto.xml,v 1.9 2006/10/24 12:02:50 neysx Exp $ --> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> -<guide link="/doc/en/vserver-howto.xml"> +<guide link="/doc/en/vserver-howto.xml" redirect="/proj/en/vps/vserver-howto.xml"> <title>Gentoo Linux-VServer Howto</title> <author title="Author"> @@ -25,421 +25,13 @@ <date>2006-10-06</date> <chapter> -<title>Introduction</title> +<title>Moved</title> <section> -<title>The Linux-VServer Concept</title> <body> <p> -The basic concept of the Linux-VServer solution is to separate the user-space -environment into distinct units (sometimes called Virtual Private Servers) in -such a way that each VPS looks and feels like a real server to the processes -contained within. -</p> - -</body> -</section> -<section> -<title>Terms used in this Howto</title> -<body> - -<table> -<tr> - <th>Term</th> - <th>Description</th> -</tr> -<tr> - <th>Linux-VServer, VServer</th> - <ti> - Linux-VServer is the official name of the project and used in this Howto - the same way - </ti> -</tr> -<tr> - <th>virtual server, vserver, guest system</th> - <ti> - All these are interchangable and refer to one instance of a server (i.e. - one virtual server) - </ti> -</tr> -<tr> - <th>host system, host</th> - <ti> - The physical machine running your Gentoo Linux will host all virtual - servers - </ti> -</tr> -<tr> - <th>util-vserver</th> - <ti> - The <c>util-vserver</c> package contains all programs necessary for - maintaining your virtual servers - </ti> -</tr> -</table> - -</body> -</section> -</chapter> - -<chapter> -<title>Host configuration</title> -<section> -<title>Install a VServer kernel</title> -<body> - -<pre caption="Install vserver-sources"> -# <i>emerge vserver-sources</i> -</pre> - -<p> -After the vserver-sources are installed it's time to configure them using -<c>make menuconfig</c>. -</p> - -<pre caption="Configure vserver-sources"> -# <i>cd /usr/src/linux-<KERNELVERSION>-vserver-<VSERVERVERSION></i> -# <i>make menuconfig</i> - -Linux VServer ---> - [ ] Enable Legacy Kernel API - [*] Disable Legacy Networking Kernel API -<comment>(Highly recommended)</comment> - [*] Enable Proc Security - [*] Enable Hard CPU Limits - Persistent Inode Context Tagging (UID24/GID24) ---> - [ ] Tag NFSD User Auth and Files - [ ] Compile Debugging Code -</pre> - -<note> -If you are using reiserfs as filesystem on the partition where guest images are -stored, you will need to enable extended attributes for reiserfs in your -kernel config and additionally add the <c>attrs</c> option in -<path>/etc/fstab</path>. -</note> - -<pre caption="Configure reiserfs options"> -File systems ---> - <*> Reiserfs support - [*] ReiserFS extended attributes -</pre> - -<pre caption="Example fstab with extended attributes"> -/dev/hdb /vservers reiserfs noatime,attrs 0 0 -</pre> - -<p> -After you've built and installed the kernel, update your boot loader and -finally reboot to see if the kernel boots correctly. -</p> - -<pre caption="Install the kernel"> -<comment>(Building the kernel)</comment> -# <i>make</i> -<comment>(Installing)</comment> -# <i>make modules_install</i> -# <i>cp arch/<arch>/boot/bzImage /boot/kernel-<KERNELVERSION>-vserver-<VSERVERVERSION></i> -<comment>(Edit bootloader config file as required and)</comment> -# <i>reboot</i> -</pre> - -</body> -</section> -<section> -<title>Setup host environment</title> -<body> - -<p> -To maintain your virtual servers you need the util-vserver package which -contains all necessary programs and many useful features. Be aware that there -is also a package called <c>vserver-utils</c>. It is a new incarnation of the -user-space implementation of the VServer kernel API, but not yet usable for -production use. -</p> - -<note> -This version of the howto requires features only available in -<c>>=sys-cluster/util-vserver-0.30.210-r6</c>. You may have to -keyword/upgrade it first. -</note> - -<pre caption="Install util-vserver"> -# <i>emerge util-vserver</i> -</pre> - -<p> -You have to run the <c>vprocunhide</c> command after every reboot in order to -setup <path>/proc</path> permissions correctly for vserver use. An init script -has been installed by util-vserver. To use it you should add it to a runlevel: -</p> - -<pre caption="vserver init script"> -# <i>rc-update add vservers default</i> -# <i>/etc/init.d/vservers start</i> -</pre> - -<note> -This init script will also start your default vservers. Read below for more -information. -</note> - -<p> -The vshelper script is used to restart virtual servers correctly. You -have to tell the kernel where the vshelper script is located: -</p> - -<pre caption="vshelper setup"> -# <i>echo 'kernel.vshelper = /usr/lib/util-vserver/vshelper' >> /etc/sysctl.conf</i> -# <i>sysctl -p</i> -</pre> - -</body> -</section> -</chapter> - -<chapter> -<title>Creating a guest template</title> -<section> -<title>Install a vserver stage3</title> -<body> - -<p> -You have to download a vserver prepared stage3 from one of -<uri link="/main/en/mirrors.xml">our mirrors</uri>. Those stages are located -under the <path>experimental/<arch>/vserver/</path> directory. -Then use the <c>vserver-new</c> script to create the initial guest. -</p> - -<p> -You have to choose a context ID for your vserver (dynamic context IDs are -discouraged) as well as the necessary network device information (In this -example eth0 is configured with 192.168.1.253/24 and the context ID is -equivalent to the last two parts of the virtual servers IP). -</p> - -<pre caption="Start stage3 installation"> -# <i>vserver-new gentoo-template \</i> - <i>--hostname gentoo \</i> - <i>--context 1253 \</i> - <i>--interface eth0:192.168.1.253/24 \</i> - <i>stage3 /path/to/stage3-<arch>-<date>.tar.bz2 <arch></i> -</pre> - -<note> -To reflect your network settings you should change -<path>/etc/conf.d/hostname</path>, <path>/etc/conf.d/domainname</path> and -<path>/etc/hosts</path> inside the guest to your needs. See <uri -link="/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2_sect1">chapter -8.b.1</uri> and <uri -link="/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2_sect4">chapter -8.b.4</uri>. The rest of your virtual servers network setup will be -done on the host. -</note> - -</body> -</section> -<section> -<title>Create the template tarball</title> -<body> - -<p> -You don't have to build a stage3 tarball for every guest. The <c>vserver-new</c> -script supports templates. In order to use them you have to create a tarball of -your vserver installation: -</p> - -<pre caption="Create template tarball"> -# <i>cd /vservers/gentoo-template</i> -# <i>tar cjvpf ../gentoo-template-<arch>-<date>.tar.bz2 ./</i> -</pre> - -<p> -To create a new guest using this tarball just use <c>vserver-new</c>: -</p> - -<pre caption="Use template tarball"> -# <i>cd /vservers</i> -# <i>vserver-new myguest \</i> - <i>--hostname myguest \</i> - <i>--context 1252 \</i> - <i>--interface eth0:192.168.1.252/24 \</i> - <i>template ./gentoo-template-<arch>-<date>.tar.bz2 <arch></i> -</pre> - -<note> -You should use a shared portage tree to keep guests small in size. Edit -<path>/etc/vservers/myguest/fstab</path> and uncomment the entries -for <path>/usr/portage</path> and <path>/usr/portage/distfiles</path>. Guests -will have read-only access to <path>/usr/portage</path> and read-write access -to <path>/usr/portage/distfiles</path>. -</note> - -</body> -</section> -<section> -<title>Test the virtual server</title> -<body> - -<p> -You should be able to start and enter the vserver by using the commands below. -If you miss commands like <c>mount</c> or <c>dmesg</c> you should <c>emerge -util-linux</c> inside your virtual server as the vserver profile doesn't ship -this package by default. -</p> - -<pre caption="Test the virtual server"> -# <i>vserver myguest start</i> -# <i>vserver-stat</i> -CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME -0 90 1.4G 153.4K 14m00s11 6m45s17 2h59m59 root server -1252 2 3M 286 0m00s45 0m00s42 0m02s91 myguest -# <i>vserver myguest enter</i> -# <i>ps ax</i> -PID TTY STAT TIME COMMAND - 1 ? S 0:00 init [3] -22887 ? Ss 0:00 /usr/sbin/syslog-ng -20496 pts/0 S 0:00 /bin/bash -login -20508 pts/0 R+ 0:00 ps ax -# <i>logout</i> -</pre> - -</body> -</section> -</chapter> - -<chapter> -<title>Maintenance made easy</title> -<section> -<title>Start guests on boot</title> -<body> - -<p> -You can start certain guests during boot. Each guest can be assigned a MARK. -Now everything you have to do is configure these MARKs in the guests -configuration and tell the init script to run all MARKed guests. -</p> - -<pre caption="Configure MARKs for each guest"> -<comment>(Do this for every guest you want to start)</comment> -# <i>mkdir -p /etc/vservers/myguest/apps/init</i> -# <i>echo "default" > /etc/vservers/myguest/apps/init/mark</i> -</pre> - -<note> -Since all guests marked with "default" are started by default, nothing more has -to be done. If you have different marks you should also update -<path>/etc/conf.d/vservers</path>. -</note> - -</body> -</section> -<section> -<title>Gentoo goodies</title> -<body> - -<p> -The util-vserver ebuild has installed some goodies for Gentoo guests. You know -<c>vserver-new</c> from the previous chapter. In this chapter, you will learn -how to use <c>vesync</c> and <c>vemerge</c> to keep portage in sync as well as -<c>vupdateworld</c> and <c>vdispatch-conf</c> to update guests. -</p> - -</body> -</section> -<section> -<title>Keep portage in sync</title> -<body> - -<p> -The script <c>vesync</c> will help you to keep the metadata cache and overlays -in sync. <c>vemerge</c> is a simple wrapper for <c>emerge</c> in guests. -</p> - -<pre caption="Examples"> -<comment>(Sync metadata for 'myguest')</comment> -# <i>vesync myguest</i> -<comment>(Sync metadata for all guests)</comment> -# <i>vesync -a</i> -<comment>(Sync metadata for all guests except 'myguest')</comment> -# <i>vesync -a -e myguest</i> -<comment>(Sync 'myoverlay' for all guests)</comment> -# <i>vesync -a \</i> - <i>--overlay /usr/local/overlays/myoverlay \</i> - <i>--overlay-host rsync://rsync.myhost.com/myoverlay \</i> - <i>--overlay-only</i> -<comment>(emerge app-editors/vim in 'myguest')</comment> -# <i>vemerge myguest app-editors/vim -va</i> -</pre> - -<note> -This script requires you to have a shared portage tree. -</note> - -</body> -</section> -<section> -<title>Update guests</title> -<body> - -<p> -Gentoo guests can share packages to save compilation time. In order to use -shared packages, you have to create a central directory for packages on the -host. We will use <path>/var/cache/vpackages</path> on the host and mount it -to <path>/usr/portage/packages</path> in every guest. -</p> - -<pre caption="Add bind mount to guest configuration"> -# <i>mkdir -p /var/cache/vpackages</i> -# <i>$EDITOR /etc/vservers/myguest/fstab</i> -<comment>(Add this line at the end)</comment> -/var/cache/vpackages /usr/portage/packages none bind,rw 0 0 -</pre> - -<p> -Now you can use <c>vupdateworld</c> to update every guest. The command is -equivalent to something like <c>emerge --deep --update --newuse world</c> -depending on command line options. -</p> - -<pre caption="vupdateworld examples"> -<comment>(Pretend update for 'myguest')</comment> -# <i>vupdateworld -p myguest</i> -<comment>(Update 'myguest' using binary packages)</comment> -# <i>vupdateworld -k myguest</i> -<comment>(Update all guests using binary packages)</comment> -# <i>vupdateworld -ka</i> -</pre> - -<note> -In order to get binary packages you can either use PORTAGE_BINHOST (see <c>man -make.conf</c>) or set FEATURES="buildpkg" in one or more guests. -</note> - -<p> -After a successful update you can easily update all configuration files with -<c>vdispatch-conf</c>. It is a simple wrapper for <c>dispatch-conf</c> and -behaves exactly the same. -</p> - -<pre caption="vdispatch-conf examples"> -<comment>(Update configuration files for 'myguest')</comment> -# <i>vdispatch-conf myguest</i> -<comment>(Update configuration files for all guests)</comment> -# <i>vdispatch-conf -a</i> -</pre> - -</body> -</section> - -<section> -<title>Contact</title> -<body> - -<p> -Please feel free to contact the <mail link="[EMAIL PROTECTED]">author</mail> or -file a bug on <uri link="http://bugs.gentoo.org">Bugzilla</uri> in case of any -problems. +This document has been moved to a <uri +link="/proj/en/vps/vserver-howto.xml">new location</uri>. </p> </body> -- [email protected] mailing list
