deaduseful/openvz-client

0.0.2 2022-08-22 14:17 UTC

This package is auto-updated.

Last update: 2025-03-22 21:56:28 UTC


README

An OpenVz client using the ssh2 client.

Installation

composer require deaduseful/openvz-client

Prerequisites

  • On Linux:
    yum install libssh2-devel
    pear config-set preferred_state beta
    pecl install ssh2
    pear config-set preferred_state stable

On Mac OS X:

    brew install libssh2
    pecl install ssh2-1.1.2

Usage

The server must have "PasswordAuthentication yes" set in the sshd_config.

OpenVz Client Usage

    $vz = new OpenVz/Client();
    print_r($vz->connect('server.domain.com', 'username', 'p4ssw0rd', 22));
    print_r($vz->su());
    print_r($vz->listvz());
    print_r($vz->listos());
    print_r($vz->exists('123'));
    print_r($vz->create('123', 'centos-4-i386-minimal', '192.168.50.51', 'n3wr00tp4ssw0rd'));
    print_r($vz->set('123', array('diskspace'=>'430209:433209', 'cpulimit'=>'20%')));
    print_r($vz->stop('123'));
    print_r($vz->start('123'));
    print_r($vz->restart('123'));
    print_r($vz->destroy('123'));

SSH Client usage

    $ssh = new Ssh/Client();
    $ssh->connect('host');
    $ssh->auth('user', 'password');
    $ssh->shellExecute('ps auxfc; ls');
    $ssh->disconnect();

About

A dead useful project for Phurix Web Hosting.

Copyright (c) 2004-2022 James Wade