All posts tagged repository

Installing OpenVZ and WebVZ in Centos 5.5

OpenVZ is an operating system-level virtualization technology based on the Linux kernel and operating system. OpenVZ allows a physical server to run multiple isolated operating system instances, known as containers, Virtual Private Servers (VPSs), or Virtual Environments (VEs).

Now we’ll try to install OpenVZ in Centos. OpenVS is an operating system-level VPS so you need to install Host Operating System ( if you are using hardware virtualization like Xen or VMware then you don’t have to install an Operating System ).

The first step is that you must install the Centos ( I am using Centos 5.5 ). I won’t explain about how to install it so you must find the tutorial yourself :P

Let’s say you already installed the Centos, next step is updating your yum package manager. Here are the steps :

  • Download the OpenVZ repo from http://download.openvz.org/openvz.repo
  • Put it in /etc/yum.repos.d directory
  • Run the yum update command

Wait until the process is complete, it will downloading all the necessary update package. ( you can find the complete tutorial in OpenVZ Wiki ).

Now we will install the OpenVZ, type this to install the OpenVZ :

yum install ovzkernel vzctl

If the installation running smooth you will have OpenVZ installed, reboot your machine :

reboot

Press any key when the Grub screen is popping out. If it’s installed then you must have 3 kernels. Choose the top kernel ( it’s the OpenVZ kernel, in my machine the name is CentOS ( 2.6.18-194.3.1.el5.028stab069.6 ).

Log in to your machine as usual, now you are running on OpenVZ kernel. The next step is we will install WebVZ ( the OpenVZ management GUI ). The WebVZ, like it’s name, is a web application that runs on Ruby on Rails. So you must have Ruby on Rails in your machine to use the WebVZ.

To help us installing the Ruby on Rails we will use Ruby Works . Ruby Works is one of the CentOS repository that provides with the newest installer of Ruby, Gem and Rails.

Here are the steps :
1.Download the repo file

wget http://rubyworks.rubyforge.org/RubyWorks.repo

2.Put it the file in the /etc/yum.repos.d
3.yum update

yum update

4.Installing the ruby packages

yum install ruby ruby-devel ruby-irb ruby-rdoc ruby-ri

5.Check the installed Ruby using this command ( it should print out the ruby version eg: ruby 1.8.6 )

ruby -v

6.Then download the latest gem at Rubyforge
7.After download the latest gem, extract it, go the folder and run the installer

ruby setup.rb

8.Check if the gem is installed successfully ( it should return the version too )

gem -v

9.Run the gem update to make sure the gem is up to date.

gem update

10.Install the rails

gem install rails -v=2.3.2

11.The WebVZ need sqlite to run, so you must install the sqlite and the gcc compiler

yum install sqlite-devel
yum install gcc make

12.And the last is installing the sqlite for ruby

gem install sqlite3-ruby -v=1.2.5

13.Download the WebVZ installer from it’s website. Extract it and run the application.

cd webvz
ruby script/server

That’s all, then you can access it via web browser http://your-ip:3000. the username is admin and the password is admin123.

Update : ( run the WebVZ as daemon )
to run WebVZ as daemon just go to it’s directory run this command instead of plain “ruby script/server”

ruby script/server &>/dev/null &

and to make it’s run everytime you boot the machine ( put it in rc.local )

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

cd /usr/local/webvz/ && /usr/bin/ruby script/server &>/dev/null &

exit 0

Updating ports in FreeBSD 8.0

Ports is the applications repository in FreeBSD. Unlike Ubuntu that provides you with command “apt-get”, in FreeBSD you must manually go to the application folder in “/usr/ports” ( the folder where Ports remain ) and search for the application that you want to install. But what’s the differences between you compile it yourself and using ports. The answer is “dependencies”.

Enough with the introduction, let’s go the main topic. So we are going to update the Ports using cvsup. Yeah… yeah… I know that there are several ways to update the ports, but I prefer to use cvsup ( because it’s the way I taught ). The steps are :
1.Install the cvsup

pkg_add -vr cvsup-without-gui

2.Copy the ports-supfile from example

cp /usr/share/examples/cvsup/ports-supfile .

3.Rehash

rehash

4.Edit the ports-supfile, find the line that say CHANGETHIS.FreeBSD.org. Change it with the mirror that is near you ( I am using BizNet )

5.Run the ports-supfile using cvsup

cvsup -g -L 2 ports-supfile

Wait until the process is complete and your ports will be updated.