All of our servers will start with this install. This base server is based on Fedora Core 5. This version of the HOWTO guides you through setting up an OpenVZ virtual server.
This is the easy part. The example commands below will use an ID of 101 and an ip address of 192.168.150.221. You will need to chose an appropreate ID and ip address for your situation. Type the follwoing.
> vzctl create 101 --ostemplate fedora-core-5-default
> vzctl set 101 --ipadd 192.168.150.221 --save
> vzctl set 101 --hostname basesever.domain.com --save
> vzctl set 101 --nameserver 192.168.150.254 --save
> vzctl set 101 --privvmpages 400M:405M --save
We should increase the VPS's disk quota to 5GB.
> vzctl set 101 --diskspace 5200000:5200000 --save
Now start the VPS.
> vzctl start 101
Once the VPS is started we need to set the root password. So type the follwoing.
> vzctl set 101 --userpasswd root:test
Type in the following to update the system.
> vzyum 101 upgrade
When its done reboot the VPS. Type:
> vzctl stop 101
> vzctl start 101
We need to add a couple of repos. One is the Fedora Core 5 Extras. The other one is my own. Add the following to /vz/template/fedora-core/5/i386/config/yum.conf
[fc5-extras] name=Fedora Extras $releasever - $basearch #baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/ mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-extras-$releasever enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras gpgcheck=1 [campworld] name=Campworld repo baseurl=http://www.campworld.net/repos/FC5/ enabled=1 gpgcheck=0
Now we'll load some php modules that will cause items such as mysql to load with it.
> vzyum 101 install php-gd php-imap php-mysql php-ncurses php-snmp php-mbstring mysql-server
Lets install postfix and get rid of sendmail.
> vzyum 101 install postfix
> vzyum 101 remove sendmail
Some misc packages
> vzyum 101 install nano createrepo yum ncftp
We need SSL support in perl. Setup is easier if you get this installed before webmin.
> vzyum 101 install perl-Net-SSLeay
Now lets install webmin.
> vzyum 101 install webmin
Next log in to the VPS. We need to add the compworld repo to yum inside the VPS. Create /etc/yum.repos.d/campworld.repo with the following info.
[campworld] name=Campworld repo baseurl=http://www.campworld.net/repos/FC5/ enabled=1 gpgcheck=0
Now we need to do a little house keeping so yum runs correctly. type the following
> localedef -v -i en_US -c en_US.UTF-8
I perfer to phpMyAdmin to manage my MySQL databases. There is no rpm for this package. This package is easy to install.
You need to get some local system user's mail. We'll use postfix's virtual file to get the emails to the right place.
1. Add the following to /etc/postfix/virtual
root admin@yourdomain.com postmaster admin@yourdomain.com abuse admin@yourdomain.com
2. Now add the configuration option to main.cf
> postconf -e "virtual_alias_maps = hash:/etc/postfix/virtual"
3. Just a couple commands to wrap everything up.
> postmap /etc/postfix/virtual
> /etc/init.d/postfix restart
We don't want to do this work every time we create a new VPS. So its time to create a cache. Type the following.
> cd /vz/private/101/
> tar czf /vz/template/cache/FC5-baseserver.tar.gz *
When you are ready to deploy a new base VPS server (aka this howto) then you use the created cache file. Below is an example fo how to create a VPS with an ID of 102.
> cp /etc/vz/dists/fedora-core.conf /etc/vz/dists/FC5-baseserver.conf
> vzctl create 800 --ostemplate FC5-baseserver --ipadd 192.168.150.222 --hostname newserver
That's it for the basic server setup. This is an example of a standard linux server setup. See the other pages for info on configuring servers for virtual webhosting or virtual email hosting.
If this is your first VPS I recommend that you don't configure it any further. You should save it for cloning to other VPSes to save time.