H-Sphere Documentation Sysadmin Guide

For more information contact us at info@h-sphere.co.uk

Installing VPS
(Experimental)

 

Related Docs:  

Configuring VPS VPS User Manual

 

VPS (Virtual Private Server) technology is a cost effective solution that allows splitting your Linux boxes into many virtually isolated servers and saves you hardware related capital investments. On the one hand, a generic virtual server can provide complete root access, can have its own processes, users, and multiple IP addresses. On the other, virtual servers share the same Linux kernel and live on the same file system, which allows shared administrative tasks, such as:

  • data backups,
  • task monitoring,
  • sharing files and directories, and more.

VPS package to be installed is a modified version of FreeVPS, a free Linux-based solution. Each FreeVPS server has:

  • memory and disk space limits,
  • private localhost network interface,
  • permissions to install its own application software and modify its config files,
  • permissions to configure/modify root application software,
  • permissions to delete, add, modify any file, including files in the /root directory.

FreeVPS extends the vserver product.

This document will guide you through preparation of the server where the VPS package would be installed, and through the VPS installation and configuration procedure, including:

IMPORTANT: This is an experimental feature. Don't install it on production servers!

 

Operating system requirements

H-Sphere VPS requires a separate box with RedHat 7.3. Other versions and operating systems are not supported. We provide you with the kernel installation package patched to support VPS. To install the patched kernel, please follow the instructions below.

System requirements:

- It is highly advised that the server runs on the Intel (i386) or Athlon processor. Cyrix and other CPUs are not recommended;
- RedHat installation should include the minimal set of packages, namely: standard RedHat kernel 2.4.18, C compiler and Perl. No X visualization packages like KDE should be installed;
- On the RedHat installation process, a special option should be chosen to install kernel source files;
- Make sure to have one large partition allocated for virtual server homes where dozens of clients would have individual Linux operating systems installed. It should be set to the /hsphere/local/vservers directory.

 

Packages

The following packages should be installed (below are the packages for i386 CPU; sets of packages for other processors are also provided):

  • kernel-2.4.18-27.7.vserver.i386.rpm - kernel, version 2.4.18-27.7, patched to support VPS;
  • modutils-2.4.18-3.7x.i386.rpm, modutils-devel-2.4.18-3.7x.i386.rpm - standard modutils package updates for the 2.4.18 kernel.
  • hsphere-vps-x.xx-x.i386.rpm - H-Sphere VPS package, x.xx-x is the release version.

 

VPS Installation

  1. Enter the server console under root. The installation procedure requires reboot, therefore it is preferable to reboot from the server console so that you may reload from the old kernel if the problem with the new one occurs.
  2. Download the packages and put them into separate directory, for example, ~inst:
    # wget http://psoft.net/shiv/HS/VPS/kernels/kernel-2.4.18-27.7.vserver.i386.rpm
    # wget http://psoft.net/shiv/HS/VPS/modutils-2.4.18-3.7x.i386.rpm
    # wget http://psoft.net/shiv/HS/VPS/modutils-devel-2.4.18-3.7x.i386.rpm
    # wget http://psoft.net/shiv/HS/VPS/hsphere-vps-x.xx-x.i386.rpm
    

    Here, x.xx-x is the release version.

    Download VPS-related packages from http://psoft.net/shiv/HS/VPS/, kernel packages from http://psoft.net/shiv/HS/VPS/kernels/.
  3. Install the packages in the following sequence:

    1) Update modutils:

    # rpm -U modutils-2.4.18-3.7x.i386.rpm modutils-devel-2.4.18-3.7x.i386.rpm
    	

    2) Install the new kernel package:

    # rpm -ivh kernel-2.4.18-27.7.vserver.i386.rpm
    	

    Go to the /boot directory to check if the kernel update takes place:

    # cd /boot
    # ls -la
    	

    The new kernel is vmlinuz-2.4.18-27.7.vserver. The old one would look like vmlinuz-2.4.18-3.

    3) Modify the boot loader, (a) for GRUB or (b) for LILO:

    (a) GRUB: Edit the /boot/grub/grub.conf configuration file:

    vim /boot/grub.conf
    

    The file should look like this:

    default=0 
    timeout=10 
    splashimage=(hd0,0)/grub/splash.xpm.gz 
    title Red Hat Linux (2.4.18-27.7.vserver) 
                  root (hd0,0) 
                  kernel /vmlinuz-2.4.18-27.7.vserver ro root=/dev/sda5 
                  initrd /initrd-2.4.18-27.7.vserver.img 
    title Red Hat Linux (2.4.18-3) 
                  root (hd0,0) 
                  kernel /vmlinuz-2.4.18-3 ro root=/dev/sda5 
                  initrd /initrd-2.4.18-3.img
    

    default=0 means that GRUB would take the first title record as the boot image, i.e., our new kernel.

    GRUB loader would update the kernel automatically after reboot.

    (b) LILO:
    Step 1: Modify the lilo.conf configuration file:

    # vi /etc/lilo.conf

    Copy and paste the kernel image settings lines and change the kernel number and the label parameter. Change the default kernel loading parameter to the new kernel label name.

    Important! Do not delete the old kernel image settings! If you delete these lines and something goes wrong with the new kernel installation, your system would not start!

    After these changes, lilo.conf would look like:

    prompt
    timeout=50
    default=linux_patched
    boot=/dev/sda
    map=/boot/map
    install=/boot/boot.b
    message=/boot/message
    linear
    
    image=/boot/vmlinuz-2.4.18-3
            label=linux
            initrd=/boot/initrd-2.4.18-3.img
            read-only
            root=/dev/sda5
    
    image=/boot/vmlinuz-2.4.18-27.7.vserver
            label=linux_patched
            initrd=/boot/initrd-2.4.18-27.7.vserver.img
            read-only
            root=/dev/sda5
    

    Step 2: Type lilo to apply changes:
    # lilo
    You will see the line:
    Added linux_patched *

    4) Check the partition by the df command. It may look like this:

    /dev/sda5               381139    102351    259110  29% /
    /dev/sda1                46636     13584     30644  31% /boot
    /dev/sda3               782696     16428    726508   3% /home
    none                     63316         0     63316   0% /dev/shm
    /dev/sda2              2158416    814668   1234108  40% /usr
    /dev/sda7               256667     25889    217526  11% /var
    /dev/sdb1             40241880    328280  37869360   1% /hsphere/local/vservers
    

    Partition where the virtual servers would run is /hsphere/local/vservers. You should provide enough space on it.

    5) Reboot the server:

    # shutdown -r now
    

    6) Check if the kernel update takes effect:

    # uname -a
    

    If the kernel version is 2.4.18-27.7.vserver, the update is performed successfully.

    7) Install the vps package (x.xx-x is the release version):

    # rpm -ivh hsphere-vps-x.xx-x.i386.rpm
    

    8) Check if the vps server is installed:

    # ls -la /usr/sbin/vserver
    

    In the /hsphere/local/vservers directory, separate folders for all virtual servers would be located.

    9) RedHat installation RPMS should be available on your server. If you don't have this directory on the server, mount the directory on CD-ROM or another server, or copy the packages to a certain directory from the installation CD or from another place.

    For example, mount CD-ROM on another server to the target directory:

    mount -t nfs domain_name_or_ip:/mnt/cdrom/RedHat/RPMS target_mount_directory
    

    For a permanent access to the RPMS directory on another server, add the following automount line to /etc/fstab:

    domain_name_or_ip:source_mount_directory target_mount_directory nfs defaults 0 0
    

    Then, mount to the target directory:

    # mount target_mount_directory
    

    10) Run the VPS configuration script:
    # /hsphere/shared/scripts/vps-configure.pl
    If your installation was successful, you'll see information about Virtual Private Server build, for example (build 1049796935):
    Virtual private server build 1049796935 found. [OK]
    With the further steps, you'll perform base configuration for all your VPSs. The default values are enclosed in square brackets '[ ]'. To accept them, press <ENTER>.

    a) You must point to all Virtual Private Servers home directory which you created in step 4:
    Please point to the directory where all Virtual Private Servers will be stored.
    Make sure it has enough disk space!
    The default is: [/hsphere/local/vservers]

    b) On the next step, the script tries to find this host's gateway. To accept the suggested value, simply press Enter. Otherwise, enter a different gateway's IP:
    Gateway will be used for routing by VPSs:[192.168.114.1]

    c) On this step, the script tries to find this host's network device. To accept the suggested value, press Enter. Otherwise, enter a different device name:
    Host's ethernet device will be used for VPSs:[eth0]

    d) Every virtual server should have its own "virtual" net card. It is recommended to leave the same name as for the network card:
    VPSs will be used alias of ethernet device: [eth0]

    e) You should specify the directory with the full set of RPMS copied or mounted on the previous step. If your RPMS are located in the default directory (/home/RedHat/7.3/RedHat/RPMS), just press Enter, otherwise, type the actual path to the RPMS directory:
    Please specify where Linux RedHat 7.3 installation RPMs are located.
    The default is: [/home/RedHat/7.3/RedHat/RPMS]

    f) Next, specify if all VPSs will start at system reboot. Type 'y', 'yes' or press Enter for YES. If you choose 'no', none of your VPSs will be started automatically, and you will have to resume every individual VPS manually in the control panel after the system reboot:
    Would you like all VPSs to start at physical server startup [y/n]?

    g) You can install additional packages for your VPSs such as: gcc compiler, perl interpreter, apache web server:
    Would you like to install additional packages such as: "gcc perl web" [y/n]?

    At this point, the script will finish the configuration with the following notification (see configuration scripts here):
    Writing to crontab: vps-cron.pl [OK]
    Writing to crontab: vps-cron-traf.pl [OK]
    Changing chkconfig... [OK]

    In the end, you'll be prompted to save the changes you have made:
    Save your changes [y/n]?

    For more options run:
    # /hsphere/shared/scripts/vps-configure.pl --help

 

VPS configuration

Check the /hsphere/local/config/vserver directory. It should have the following structure:

total 9
drwxr-xr-x    2 root     root         1024 Apr 11 04:23 cp
-rw-r--r--    1 root     root         2373 Apr 10 08:15 rpm_base.cfg
-rw-r--r--    1 root     root          691 Apr 11 04:23 vps.cfg
-rw-r--r--    1 root     root         2379 Apr 10 08:15 vps.cfg.default
-rw-r--r--    1 root     root            9 Apr 11 04:23 vps.list

Here, cp directory is the directory where the virtual servers configuration files are located. Every hour cron runs the /hsphere/shared/scripts/cron/vps-cron.pl script which analyzes the cp/vps_domain.com.in configuration files. After that, the same script writes all the created data to cp/vps_domain.com.out files.

Then, the control panel will run the /hsphere/shared/scripts/cron/vps-cron-traf.pl script to analyze the .out files. If configuration is successful, the control panel would regard these virtual private servers created, and these resources would be provided to the user.

The minimal set of the VPS installation packages is listed in the rpm_base.cfg file.

If you have problems with VPS, you may check the VPS log file: /var/log/hsphere/vps.log.


Related Docs:  

Configuring VPS VPS User Manual



Home   Products   Services   Partners   Support   News   Contact   Forum
© Altaire Limited.
All rights reserved.