Poll

Should I add IPv6 support to the VMs?

Hell yeah! (Yes)
1 (100%)
No way! (No)
0 (0%)
What the f*ck? (What?)
0 (0%)
Get the f*ck out of here! (Don`t have opinion!)
0 (0%)

Total Members Voted: 1

Voting closed: August 02, 2017, 09:22:04 PM

Author Topic: OpenVZ with CWP  (Read 89668 times)

0 Members and 1 Guest are viewing this topic.

Offline
***
OpenVZ with CWP
« on: March 12, 2017, 03:54:42 PM »
Hello people,
As for now that you can use CWP just for shared hosting I decided to create a module for OpenVZ with some functions:
Admin Panel:
1. Install OpenVZ on your system (keep in mind that installing OpenVZ requires reboot for new kernel!!!)
2. Create containers
3. Set IPv4 & IPv6 to the containers
User Panel:
1. Boot container
2. Shutdown container
3. Reboot container
4. Reinstall container
5. SSH Console to the container through CWP
6. Change hostname
7. Change root password
I will also try to make a module where you add more servers and you create/delete containers through just 1 main CWP.
I also have plan to make the same for KVM and Xen, but I`m still waiting for 2x Dell PowerEdge 1950 and 1x Dell PowerEdge 2950(I know they are old rigs, but are good for testing) from UK and for the moment I have a free server which supports only OpenVZ.
All the scripts/modules will be provided for FREE FOREVER from me, but ionCube crypted. Some people will say "I want open source". I don`t agree with that since I saw a post in the forum that somebody want to change the logo of CWP and I don`t like that when somebody is offering something good to you for free you want to change logo/copyright to sign it on your name.I will provide my full source code unencrypted to CWP developers if they want to improve it or add it to a new version(I know that my way of writing PHP code sux, so may be they will rewrite it full, but ... ).
If you have any ideas what else can be added for OpenVZ I will be happy if you share them with me.
Thank you for reading and wait for the first release.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #1 on: March 14, 2017, 07:47:28 AM »
Got some strange problem on the admin panel:
Code: [Select]
$root_file = "/root/.my.cnf"; -> From which file to get mysql password
$lines = file($root_file); -> Open file
list($password, $pass) = explode("=", $lines[1]); -> Get the password after =
$sql = new mysqli('localhost', 'root', $pass, 'root_cwp'); -> Making connection to the database(as the example in php.net)

if (!$sql) { -> Checking if connection was successful
    echo "Error: Unable to connect to MySQL." . PHP_EOL; -> Error message
    echo "<br>Debugging errno: " . mysqli_connect_errno() . PHP_EOL; -> Error number
    echo "<br>Debugging error: " . mysqli_connect_error() . PHP_EOL; -> Error
    exit;
}

$query = "SELECT username FROM user ORDER BY id"; -> Query
$result = mysqli_query($sql, $query); -> Execute query
while ($row = mysqli_fetch_array($result)) { -> Fetching the array
        $user = '<option value=". $row[\'username\'] .">'; -> Setting $user for dropdown menu
    }

And here comes the error:
Code: [Select]
Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/modules/openvz_cct.php on line 52I checked error 1045 in MariaDB.com:
Code: [Select]
1045 28000 ER_ACCESS_DENIED_ERROR Access denied for user '%s'@'%s' (using password: %s)Maybe because the last 2 days I slept only 2 hours and I`m making a mistake which I can`t see. If somebody see it please correct me. Will be appreciated.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
*
Re: OpenVZ with CWP
« Reply #2 on: March 14, 2017, 12:00:50 PM »
when using files from linux (like password from a file) you should check that there is no new lines, empty spaces....
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
***
Re: OpenVZ with CWP
« Reply #3 on: March 14, 2017, 12:05:04 PM »
Ok, I didn`t go to sleep. I continued to try to fix my error, but I`m still stuck. I wrote down the things new way using PDO, but now I got a new error:
Code: [Select]
$file = "/root/.my.cnf";
$lines = file($file);
list($password, $pass) = explode("=", $lines[1]);
class Database{
    // specify your own database credentials
    private $host = "127.0.0.1";
    private $db_name = "root_cwp";
    private $username = "root";
    private $password = $pass; -> Line 13 making the error;
    public $conn;

    // get the database connection
    public function getConnection(){

        $this->conn = null;

        try{
            $this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->username, $this->password);
        }catch(PDOException $exception){
            echo "Connection error: " . $exception->getMessage();
        }

        return $this->conn;
    }
}
And in one moment:
Code: [Select]
Fatal error: Constant expression contains invalid operations in /usr/local/cwpsrv/htdocs/resources/admin/modules/database.php on line 13
Never got an error like that before, so please somebody help me with it.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #4 on: March 14, 2017, 12:10:50 PM »
when using files from linux (like password from a file) you should check that there is no new lines, empty spaces....
When I use that way:
Code: [Select]
$file = "/root/.my.cnf";
$lines = file($file);
list($password, $pass) = explode("=", $lines[1]);
The command echo returns everything that I need:
Code: [Select]
echo $pass; returns the password for MariaDB(MySQL) from the file. But using it with connection function/class gives an error.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #5 on: March 18, 2017, 09:05:04 PM »
Sorry guys, I've been busy last days with one of my companies and I didn't had time to continue with OpenVZ. Next few days I'll try to find some free time and to finish the admin panel at least. With the speed the project is going and with the no free time I've got ... I see the first release around june. Sorry about that. I will keep you informed how is it going.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #6 on: April 04, 2017, 07:56:31 PM »
Ok, guys, some bad news. As I see you can`t install OpenVZ on CentOS 7.x:
Code: [Select]
---> Package vzkernel.x86_64 0:2.6.32-042stab120.20 will be installed
--> Processing Dependency: /sbin/mkinitrd for package: vzkernel-2.6.32-042stab120.20.x86_64
--> Processing Dependency: /sbin/mkinitrd for package: vzkernel-2.6.32-042stab120.20.x86_64

Packages skipped because of dependency problems:
    vzkernel-2.6.32-042stab120.20.x86_64 from openvz-kernel-rhel6
[root@odyn ~]#

It`s not supported anymore. You have to install virtualizor or proxmox. Both I don`t like. So we keep up to CentOS 6.8 (Final) even after it`s EOL.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #7 on: June 23, 2017, 01:58:56 AM »
Hello again from me. After "rm -rf /" few times on the developing machine because I got angry on the OpenVZ, vzctl and php<->bash, last night around 4:30 I started from zero. The admin panel is ready up to: view VMs, start VM, stop VM, suspend VM and delete(destroy) VM. Create VM is done on 40%. This is ready in 2h. Everything is responsive, so it`s supposed to be available to be looking good on mobile devices.  If the VM is stopped you will see only "Start" button, if the VM is started you will see only "Stop" button. The same for suspend/unsuspend. I will post few images on saturday or sunday, because now I am far away from the developing machine and I don`t have access to it(only local).
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #8 on: June 24, 2017, 06:26:24 AM »
Hello ppl,
I see a light at the end of the tunnel:
https://thegeeksalive.com/how-to-setup-openvz-7-on-centos-7/
From OpenVZ there`s a new kernel for CentOS 7. Hope thee will be not so much changes on vzctl so I don`t need to write everything from zero. Stay tuned!
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #9 on: June 24, 2017, 07:24:56 PM »
Ok guys, I`m back next to the developing machine. As I promised today I give you the first screenshot:

When you press the "Suspend" button it`s automaticly stopping the VM, when you press the "Unsuspend" button it`s automaticly starting the VM and also changing the status and the buttons. Now I`m going to work on the "Create New VM" and "Edit VM"(which is just to press on "#1" "101" or "hostname" to send you directly to edit the VM.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #10 on: June 25, 2017, 04:40:37 AM »
Question to Administrator, Igor S. or everybody who have access to CWP source:
What class to use to make a "Text:  <select class="" name=""><option value="">Text</option></select>" smaller because I don`t want it on the whole page?
<select class="span3"> ? <select class="form-control input-sm"> ? <select class="?">
Like on: Server Settings -> Crontab -> Add Custom Cron Jobs

I`m waiting for quick answer or I will write my own class in the .css  ;D or I will use some <div> ;D
« Last Edit: June 25, 2017, 04:56:11 AM by darkness »
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
*
Re: OpenVZ with CWP
« Reply #11 on: June 27, 2017, 02:54:24 AM »
Keep up the great work! I'll keep an eye on this progress ;) Don't get discourage and keep making this a reality for CWP :D
Trying to help people :)
Chords and Lyrics

Offline
***
Re: OpenVZ with CWP
« Reply #12 on: June 27, 2017, 08:06:59 PM »
I`ll keep up the work, but last few days because of big storms here in Bulgaria and specially in the village I choose to live to run away from the town, there was problem with the electricity and I didn`t had too much time to work. Also I`m working on my new kitchen and my living room which I make alone and also on my company and my bees. So please be patient and I promise to give the ready project ASAP.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #13 on: July 01, 2017, 04:42:37 AM »
Hello again people,
http://imgur.com/a/RkZao <- Image
This is kind of sample of the form for creating new VM. One more thing is gonna go inside 100% just wondering how to make it. Dropdown menu to give you to choose from all CWP Packages or you will need to create VPS* packages and to show only them in a dropdown menu. Also we will need to create a new user in CWP, so the extra things became two ... for now :) If I spend here 5 more minutes the things will become so much that nothing will be left for version 0.2/2.0 :D
See you after few lines of code :)
« Last Edit: July 01, 2017, 04:44:49 AM by darkness »
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Offline
***
Re: OpenVZ with CWP
« Reply #14 on: July 01, 2017, 08:20:35 AM »
After thinking few hours I decided to use the CWP Packages info for the creation of the VM. Just the disk quota from them and the bandwidth. So now I will rewrite the "Create New Virtual Machine" and you don`t have to include every time disk space when creating new.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...