In der Datei /usr/lib64/util-vserver/defaults/debootstrap.uri ist als default das debootstrap-Image von ftp.debian.org angegeben. Auf AMD64 Systemen ist die Datei entsprechend anzupassen:
http://amd64.debian.net/debian-amd64/pool/main/d/debootstrap/debootstrap_0.3.3_all.deb
vserver-build.debootstrap-patch
--- vserver-build.debootstrap.orig 2006-03-07 20:30:46.000000000 +0100
+++ vserver-build.debootstrap 2006-03-07 20:31:18.000000000 +0100
@@ -102,6 +102,7 @@
## Wash the calculated architecture
case $arch in
(i?86|athlon) arch=i386;;
+ (x86_64) arch=amd64;;
esac
test -z "$arch" || echo "$arch" >$DEBOOTSTRAP_DIR/arch
debootstrap
vserver vs01 build --context 1001 --hostname vs01 \ --interface vs01=eth0:192.168.100.101/24 \ -m debootstrap -- -d sarge -m http://amd64.debian.net/debian-amd64
vserver vs01 start
# vserver vs01 start Starting system log daemon: syslogd. Starting kernel log daemon: klogd. Starting MTA: exim4. Starting internet superserver: inetd. Starting deferred execution scheduler: atd. Starting periodic command scheduler: cron.
ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:81:59:52:7B
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:62797 errors:0 dropped:0 overruns:0 frame:0
TX packets:42758 errors:0 dropped:0 overruns:0 carrier:0
collisions:20901 txqueuelen:1000
RX bytes:76665180 (73.1 MiB) TX bytes:6469063 (6.1 MiB)
Interrupt:10
eth0:vs01 Link encap:Ethernet HWaddr 00:E0:81:59:52:7B
inet addr:87.106.33.70 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:10
apt
# apt-get update Hit http://amd64.debian.net sarge/main Packages Get:1 http://amd64.debian.net sarge/main Release [110B] Fetched 110B in 0s (4253B/s) Reading Package Lists... Done
apt
# apt-get install ssh Reading Package Lists... Done Building Dependency Tree... Done Suggested packages: ssh-askpass xbase-clients The following NEW packages will be installed: ssh 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 748kB of archives. After unpacking 1847kB of additional disk space will be used. Get:1 http://amd64.debian.net sarge/main ssh 1:3.8.1p1-8.sarge.4 [748kB] Fetched 748kB in 0s (5189kB/s) Preconfiguring packages ... ... Selecting previously deselected package ssh. (Reading database ... 7509 files and directories currently installed.) Unpacking ssh (from .../ssh_1%3a3.8.1p1-8.sarge.4_amd64.deb) ... Setting up ssh (3.8.1p1-8.sarge.4) ... Creating SSH2 RSA key; this may take some time ... Creating SSH2 DSA key; this may take some time ... Restarting OpenBSD Secure Shell server: sshd.
Nun noch das Kennwort für root setzen:
passwd
vs01:/# passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully vs01:/#
Jetzt kann man auch vom Host-System aus auf den vserver zugreifen:
ssh
[root@host ~]# ssh vs01 The authenticity of host 'vs01 (87.106.133.170)' can't be established. RSA key fingerprint is ff:f4:70:96:4e:83:06:34:5f:68:2c:68:fd:55:df:ff. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'vs01,87.106.133.170' (RSA) to the list of known hosts. Password: vs01:~#
apt
# apt-get install apache2
Der Apache Daemon muss auf die virtuelle IP-Adresse gebunden werden, falls auf dem Master bereits ein anderer Dienst auf dem Port läuft.
/etc/apache2/ports.conf
Listen 87.106.133.170:80
Damit man nicht sofort anhand der Fehlerseite herausbekommt, mit welchen Modulen und mit welcher Version der Apache installiert ist, sind die ServerTokens anzupassen.
/etc/apache2/apache2.conf
ServerTokens Major
Zusätzliche Module einrichten (z.B. mod_rewrite)
/etc/apache2
cd /etc/apache2/mods-enabled ln -s ../mods-available/rewrite.load
apt
apt-get install libapache2-mod-suphp php4-pear
Die PHP Installation kann getestet werden, indem ein unprivilegierter User angelegt und die phpinfo-Seite aufgerufen wird.
phpinfo
useradd -d /home/u01 -m u01 echo "<?php phpinfo(); ?>" > /var/www/info.php chown u01.nogroup /var/www/info.php lynx http://127.0.0.1/info.php
pear
pear upgrade Archive_Tar pear upgrade XML_RPC-1.4.0 apt-get install cpp pear upgrade PEAR-1.3.3 pear upgrade PEAR-1.4.0 pear channel-update pear.php.net pear upgrade-all
Das Ergebnis sieht dann so aus
pear list
Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.1 stable Console_Getopt 1.2 stable DB 1.7.6 stable HTTP 1.4.0 stable Mail 1.1.9 stable Net_SMTP 1.2.6 stable Net_Socket 1.0.6 stable PEAR 1.4.8 stable XML_Parser 1.2.7 stable XML_RPC 1.4.5 stable