Get WebVZ On Debian Etch To Administrate OpenVZ

Want to support HowtoForge? Become a subscriber!
 
Submitted by snapo (Contact Author) (Forums) on Tue, 2008-05-27 12:34. :: Debian | OpenVZ | Virtualization

Get WebVZ On Debian Etch To Administrate OpenVZ

1.0 Information:

Author: Mike J. mike.j[at ]rewt.ch
Date: 22. May 2008
Content: Management-Tool WebVZ

 

1.1 Beginnings:

First you must have OpenVZ installed and configured. You can find a tutorial to do this on HowtoForge. Because of a small problem/error in Debian Etch, it is not possible to update the Rubygems system because a Require in the gems is missing. But we can solve it with a simple edit of the file. WebVZ is one of the simplest and most powerful web management tools for OpenVZ.

 

2.0 Needed Packages:

We must install some additional packages to get WebVZ running. WebVZ does not need a web server, because they deliver it with WebRick.

Let's start...

main:~/webvz.1.5# apt-get install ruby rubygems libsqlite3-ruby sqlite3 irb1.8 libopenssl-ruby1.8 libreadline-ruby1.8 rdoc1.8 nano

You must say Yes to the installation.

 

2.1 Solve Debian error

To solve the error on Debian, so that we can update gems you must do the following:

main:~# nano /usr/bin/gem

Edit the file so that it looks like this:

#!/usr/bin/env ruby
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/open-uri'
Gem.manage_gems
required_version = Gem::Version::Requirement.new(">= 1.8.0")
unless  required_version.satisfied_by?(Gem::Version.new(RUBY_VERSION))
  puts "Expected Ruby Version #{required_version}, was #{RUBY_VERSION}"
  exit(1)
end
# We need to preserve the original ARGV to use for passing gem options
# to source gems.  If there is a -- in the line, strip all options after
# it...its for the source building process.
args = !ARGV.include?("--") ? ARGV.clone : ARGV[0...ARGV.index("--")]
Gem::GemRunner.new.run(args)

Save the File with CTRL + X and type Y to Save.

 

2.2 Update Gems

Type in your console the following to update Gems, without the update WebVZ doesn't run....

main:~# gem update --system

You need to install Rails 2.0.2:

main:~# gem install -v=2.0.2 rails

 

3.0 Configuring WebVZ

Use the following commands to get WebVZ:

main:~# wget http://garr.dl.sourceforge.net/sourceforge/webvz/webvz.1.5.tar.gz

Extract the downloaded archive:

main:~# tar -xzvf webvz.1.5.tar.gz

Go into the WebVZ directory:

main:~# cd webvz.1.5

Because of some small changes on the Debian System we need to set some softlinks in our system. Do it exactly as shown, otherwise WebVZ is not usable:

main:~/WebVZ# ln -s /var/lib/vz /vz
main:~/WebVZ# ln -s /usr/bin/irb1.8 /usr/bin/irb

main:~/WebVZ# ln -s /etc/sysconfig/vz-scripts/ /etc/vz/conf

 

3.1 Starting and Setting up WebVZ

To start WebVZ you can start the server with this command. You can put it in your init.d or startup scripts.... what you like.

main:~/WebVZ# ruby script/server

If all is well a message will come and say Webrick is started on port 3000.

Now we must connect with a web browser to http://[youripaddress]:3000. Log in with

Username: admin
Passwort: admin123

First of all to secure WebVZ, we need to create an own account. Log in with your account details and destroy the admin account.

 

4.0 Links

Debian: http://www.debian.org
OpenVZ: http://openvz.org
WebVZ: http://webvz.sourceforge.net


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Rob (not registered) on Tue, 2008-09-23 14:56.
I wasn't sure why there were two guides for webvz, then I noticed this one is for 1.5. For the latest 2.0, see http://www.howtoforge.com/install-webvz-2.0-on-debian-etch-to-administrate-openvz. I also posted comments there about how I got it to work with Ubuntu 8.04.
Submitted by psyhuaska (registered user) on Wed, 2008-05-28 22:57.

hello,

thanks for the howto..
After "gem update --system" i was getting a error @ line 7.

the problem was that rubygems was not installed.

To install rubygems:
apt-get install rubygems

Thanks

Submitted by snapo (registered user) on Thu, 2008-06-05 15:33.

am sorry for this... i have forget to insert the rubygems... thanks for your information... i will update the tutorial...

best greetings snapo