OpenVZ on CentOS 5.2
- January 9th, 2009
- By Jason Zerbe
- Write comment
OpenVZ setup procedure followed – January 6th, 2009
host machine – 1.5ghz Pentium 4 (i386), 1GB ram, 40GB hard disk drive
host os – CentOS 5.2
for more detailed installation information see: http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf
This installation of CentOS 5.2 is on a i386 machine, be sure to substitute in for a 64-bit machine if you have one. Following most/all of the instructions will give you an OpenVZ CentOS 5.2 host with browser-based administration of your VPS(es) with vtonf. This cookbook assumes running knowledge of how to edit configuration files via “vi”, using yum to install dependencies/software, and how to install via tarballs (.tar.gz).
- Install latest CentOS distro on physical server (at the time of writing this, it was 5.2)
- minimal install only requires disc 1 – “CentOS-5.2-i386-bin-1of6.iso”
- choose your mirror: http://isoredirect.centos.org/centos/5/isos/i386/
- partition setup note: 5GB for root filesystem, 1.25X-2X size of RAM for swap, rest of space for /vz (the VPS nodes and OS templates)
- During the category/task selection, deselect all package categories, and choose the “Customize now” option at the bottom of screen. During the customized package selection, deselect everything. This will allow for a “minimal” install with only disc 1.
- Configure static ipv4/ipv6 address(es) – /etc/sysconfig/network/
- Setup dns nameservers – /etc/resolv.conf
- Run an update: yum update
- Follow hotwo: http://www.howtoforge.com/installing-and-using-openvz-on-centos5.2
- Download VTONF – http://vtonf.com/downloads.html
- tar xzvf on the archive you just downloaded and cd into the created directory
- Follow on screen instructions to complete setup
- If you wanna go crazy with the customizations get into the “/etc/vtonf/” directory and check things out
- To allow connections to vtonf from IPv4/6 addresses other than through the localhost, modify the code block within “/etc/vtonf/vtonf.conf” so it looks like the below code block. Note the second line!
fastcgi.server = ( ".php" =>
( "*" =>
( "socket" => "/tmp/vtonf.socket",
"bin-path" => "/usr/local/vtonfphp/bin/php",
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "4",
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
)
)
) - Remember to modify the OpenVZ host IPTABLES rules so that it allows traffic to the VPS nodes. I just turned mine off (service iptables stop; chkconfig iptables off), because I got an external firewall/router in my home LAN.
That’s it you are good to go to start reselling VPSes to clients!