Gentoo VPS Host

Previous Top Next

We currently support only Gentoo Linux based vservers. The instructions on preparing the host are found below or you can choose to purchase this service from us. Please contact sales for further details. In order to use virtual server technoloy, the host server Linux distribution needs vserver kernel and other tools patches applied.

 

 

1. Basic Gentoo Configuration

 

1.1 Setting the Date/Time

 

You need to check your date/time and update it. A mis-configured clock may lead to strange results when you run emerge --sync for example.

 

# date

Mon May 15 16:21:18 CEST 2006

 

If everything is ok with your time/date you can go to next step, if not set your date by entering date MMDDhhmmYYYY syntax (Month, Day, hour, minute and Year). For instance, to set this date above you need to enter:

 

# date 051516212006

 

1.2 Updating the Portage tree

 

Next step is to update your Portage tree to the latest version. In order to do that just enter:

 

# emerge --sync

 

Or if you are using some terminal like serial console you can the --quiet option to speed up this process:

 

# emerge --sync quiet

 

1.3 Timezone

 

You also need to select your timezone so that you system knows where isiti located. The list of timezones is located in /usr/share/zoneinfo, so to list it use:

 

# ls /usr/share/zoneinfo

 

After that, you need to copy appropriate time zone to /etc/localtime. Let say that we want to use GMT:

 

# cp /usr/share/zoneinfo/GMT /etc/localtime

 

1.4 System Logger

       

Unix and Linux have an excellent history of logging capabilities -- if you want you can log everything that happens on your system in log files. This happens through the system logger. Gentoo offers several system loggers to choose from. There are sysklogd, which is the traditional set of system logging daemons, syslog-ng, an advanced system logger, and metalog which is a highly-configurable system logger.

 

The following example installs syslog-ng:

 

# emerge syslog-ng

# rc-update add syslog-ng default

 

Command rc-update add syslog-ng default will add syslog-ng daemon to default runlevel, so its gonna run each time when your machine is rebooted by default.

 

1.5 Cron Daemon

 

A cron daemon executes scheduled commands. It is very handy if you need to execute some command regularly. We will install vixie-cron.

 

# emerge vixie-cron

# rc-update add vixie-cron default

 

1.6 File Indexing

 

If you want to index your system's files so you are able to quickly locate them using the locate tool, you need to install sys-apps/slocate.

 

# emerge slocate

 

 

 

2. Basic network configuring

 

2.1 Host name

 

First we will set the host name:

 

# nano -w /etc/conf.d/hostname

 

Set the HOSTNAME variable to your host name:

 

HOSTNAME=”yourboxname”

 

 

2.2 Domain name

 

Second we set the domain name:

 

# nano -w /etc/conf.d/domainname

 

Set the DNSDOMAIN variable to your domain name

 

DNSDOMAIN="yourdomain.com"

 

 

2.3 Network connection

 

Configure your network interface by opening /etc/conf.d/net with your favorite editor:

 

# nano -w /etc/conf.d/net

 

To enter your own IP address, netmask and gateway, you need to set both config_eth0 and routes_eth0:

 

config_eth0=( "$IPADDRESS netmask $NETMASK brd $BROADCAST" )

routes_eth0=( "default gw $GATEWATIP" )

 

For this information, please contact your network administrator.

 

 

To have your network interfaces activated at boot, you need to add them to the default runlevel:

 

# rc-update add net.eth0 default

 

 

 

3. Kernel

 

3.1 Install vserver sources

 

# emerge vserver-sources

 

There are two ways co configure your kernel: using make menuconfig or genkernel. We will explain both ways.

 

# cd /usr/src/linux-<KERNELVERSION>-vserver-<VSERVERVERSION>

# make menuconfig

 

 

After this, go to section Linux Vserver and chose: Disable Legacy Networking Kernel API, Enable Proc Security, Enable Hard CPU Limits:

 

Linux VServer --->

[ ] Enable Legacy Kernel API

[*] Disable Legacy Networking Kernel API

(Highly recommended)

[*] Enable Proc Security

[*] Enable Hard CPU Limits

Persistent Inode Context Tagging (UID24/GID24)  --->

[ ] Tag NFSD User Auth and Files

[ ] Compile Debugging Code

 

 

Exit after making selection.

 

 

3.2 Select file systems

If you are using ReiserFS select Reiserfs support, ReiserFS extended attributes:

 

File systems  --->

<*> Reiserfs support

[*]   ReiserFS extended attributes

 

3.3 IP Tables Configuration

IPtables need to be configured as kernel module in order for PBXware to send QoS requests. To to that go to:

Networking  --->

       Networking options  --->

               [ ] Network packet filtering (replaces ipchains)  --->

                       --- Network packet filtering (replaces ipchains)                                    

               [ ] Network packet filtering debugging (NEW)                                   

                       Core Netfilter Configuration  --->                                             

                       IP: Netfilter Configuration  --->                                             

                       IPv6: Netfilter Configuration (EXPERIMENTAL)  --->

 

Then select all modules that you need such as modules for Mangle and DSCP. After that, save your configuration and continue with next step.

 

3.4 Build and install kernel

 

(Building the kernel)

# make

(Installing)

# make modules_install

# cp arch/<arch>/boot/bzImage /boot/kernel-<KERNELVERSION>-vserver-<VSERVERVERSION>

(Edit bootloader config file as required and)

# reboot

 

You can do this by using genkernel, also. We need to install it first:

 

# emerge av genkernel

 

After this step all we have to do is to run:

 

# genkernel -menuconfig all

 

After this step, you need to follow instructions above for kernel configuring. Once done, please go to Exit and Save. Genkernel will build and install your kernel.

 

 

4. Vserver preparations

 

4.1 Update boot loader

 

Update your boot loader and finally reboot to see if the kernel boots correctly. If you are using grub you need to edit /boot/grub/grub.conf

 

# nano /boot/grub/grub.conf

 

title=Gentoo Linux kernel-<KERNELVERSION>-vserver-<VSERVERVERSION>

root (hd0,0)

kernel /boot/kernel-<KERNELVERSION>-vserver-<VSERVERVERSION>

init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev

initrd /boot/initramfs-<KERNELVERSION>-vserver-<VSERVERVERSION

 

After this step we have kernel configured.

 

 

4.2 Install vserver utils

 

# emerge util-vserver

 

You have to run the vprocunhide command after every reboot in order to setup /proc permissions correctly for vserver use. An init script has been installed by util-vserver. To use it you should add it to a runlevel:

 

# rc-update add vservers default

# /etc/init.d/vservers start

 

 

The vshelper script is used to restart virtual servers correctly. You have to tell the kernel where the vshelper script is located:

 

 

# echo 'kernel.vshelper = /usr/lib/util-vserver/vshelper' >> /etc/sysctl.conf

# sysctl -p

 

 

4.2 Download stage3 tarball

 

# cd /root

# wget $LINK

(Please see the full link in the order email received)

 

 

4.4 Create a vserver

 

# vserver-new vserverone --hostname vserverone --context 1253 --interface eth0:213.166.5.99/24 stage3 /root/gentoo.tar.bz2 x86

 

Above example will create a new vserver with:

Vserver Name: vserverone

Hostname: vserverone

Context: 1253

Network Interface: 213.166.5.99

VPS Distro: Gentoo

 

Please change above values to your requirement. Also the "Context" value must be different for each vserver.

 

Now your system is ready to install PBXware vservers.