fox2mike 05/06/17 10:06:56 Added: xml/htdocs/doc/en vserver-howto.xml Log: #90122, New Linux-VServer guide, thanks to Benedikt Boehm.
Revision Changes Path 1.1 xml/htdocs/doc/en/vserver-howto.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/vserver-howto.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/vserver-howto.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo Index: vserver-howto.xml =================================================================== <?xml version='1.0' encoding="UTF-8"?> <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/vserver-howto.xml,v 1.1 2005/06/17 10:06:56 fox2mike Exp $ --> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> <guide link="/doc/en/vserver-howto.xml"> <title>Gentoo Linux-VServer Howto</title> <author title="Author"> <mail link="[EMAIL PROTECTED]">Benedikt Boehm</mail> </author> <author title="Editor"> <mail link="[EMAIL PROTECTED]">Shyam Mani</mail> </author> <abstract> In this Howto you will learn to setup a basic virtual server using the Linux-VServer Technology </abstract> <!-- The content of this document is licensed under the CC-BY-SA license --> <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> <license/> <version>1.0</version> <date>2005-06-17</date> <chapter> <title>Introduction</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, vserver utils</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>Creating a VServer template</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 ---> <comment>(Required by current utils)</comment> [*] Enable Legacy Kernel API <comment>(Do not set!)</comment> [ ] 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> <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/i386/boot/bzImage /boot/kernel-<KERNELVERSION>-vs<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 usefull features. </p> <pre caption="Install vserver utils"> # <i>emerge util-vserver</i> </pre> <p> If you use Proc Security you have to "unhide" certain files in your <path>/proc</path> directory in order to make them available in virtual servers. There is a script called <c>vprocunhide</c> in <path>/usr/lib/util-vserver</path> which unhides files specified in <path>/usr/lib/util-vserver/defaults/vprocunhide-files</path>. The util-vserver ebuild installed a init-script which uses the <c>vprocunhide</c> command. Add it to your runlevel: </p> <pre caption="vprocunhide init script"> # <i>rc-update add vprocunhide default</i> # <i>/etc/init.d/vprocunhide start</i> </pre> <p> The vshelper script is used to correctly stop and restart virtual servers. 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> <section> <title>Basic Skeleton configuration</title> <body> <p> You have to create some configuration files and directories to get your virtual server up and running. We use the skeleton build mode from the util-vserver package to setup our basic configuration. </p> <p> The util-vserver package uses <path>/vservers</path> to store all virtual servers by default. You can put your servers somewhere else by specifying <c>--rootdir=/path/to/vserver/root</c> to the build command below. </p> <p> There is a new baselayout-vserver ebuild in portage which supports the plain init-style, i.e.; you don't have to use the gentoo init style anymore. The plain init-style uses <c>init</c> and <path>/etc/inittab</path> to manage runlevels and init scripts (considered more stable and is the default now). </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.254/24 and the context ID is equivalent to the last two parts of the virtual servers IP). </p> <pre caption="Basic configuration"> # <i>vserver gentoo build -m skeleton \</i> <i>--hostname gentoo \</i> <i>--initstyle plain \</i> -- [email protected] mailing list
