Control Web Panel

Developers => I can build it => Topic started by: darkness on March 12, 2017, 03:54:42 PM

Title: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: Administrator 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....
Title: Re: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: darkness 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).
Title: Re: OpenVZ with CWP
Post by: darkness 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!
Title: Re: OpenVZ with CWP
Post by: darkness 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:
(http://www.born2host.com/img1.png)
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.
Title: Re: OpenVZ with CWP
Post by: darkness 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
Title: Re: OpenVZ with CWP
Post by: MyBuddyBen 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
Title: Re: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: darkness 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 :)
Title: Re: OpenVZ with CWP
Post by: darkness 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.
Title: Re: OpenVZ with CWP
Post by: darkness on July 03, 2017, 10:18:21 PM
Hello again guys,
I just wanted to prepare you mentally that you will need around 8-9 GB free space to download all the templates for the VMs. Depending on your download speed it can take from 30min to a lot of time(if you have such a sh*t internet, don`t play with hosting and VMs :) ). I`ve did a very big research on google to find as much as possible templates. Also I checked all free web panels who offer VPS option and I want CWP to be able to offer the best! By the way the admin panel is 95% ready! Just to add the IP Pool option to it and the Downloader for the templates which is 1h job. After it comes the testing and the start of the client panel. See you soon!
Title: Re: OpenVZ with CWP
Post by: darkness on July 04, 2017, 08:16:27 AM
As I`m not familiar with iptables (got xp with pf, not iptables) I would request help from administrators and users.
The situation:
As we are going to have multiple virtual machines on one host and may be 80% of them will be with local IP we need to set port forwarding for every single VM so the user can log directly to his VM.
Ex:
SERVER_PUBLIC_IP:PORT -> SERVER_LOCAL_IP:PORT
So if the user try to connect to SERVER_PUBLIC_IP on PORT to be redirected to SERVER_LOCAL_IP on PORT.
I don`t know how is in other countries, but in my country to get an A, B, C class network of IP addresses costs thousands. Even if you have a C class network of IP addresses you will need to forward ports for SSH, HTTP, POSTFIX, ...
So again my question is:
How to setup iptables to forward SERVER_PUBLIC_IP:PORT for SSH to SERVER_LOCAL_IP:PORT
How to setup iptables to forward 88.254.168.171:2951 for SSH to 192.168.1.105:2951
I beg you for a quick response. Thanks in advance.
Title: Re: OpenVZ with CWP
Post by: Netino on July 06, 2017, 05:21:23 PM
(...)
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 think this is the purpose of "brands".
You can brand anything copyrighted.

Don't forget you are posting in a forum, branded with "SMF - Simple Machines Forum", but the SMF software allows perfectly to use the logo AND the signature of CWP.
Title: Re: OpenVZ with CWP
Post by: darkness on July 06, 2017, 10:21:31 PM
SMF allows this in the Configuration. CWP doesn`t. If there was option "Upload Your Logo" I don`t mind, but since there`s not I mind it. May be in the next release of CWP there will be an option to upload your own logo under the logo of CWP, who knows ..
Title: Re: OpenVZ with CWP
Post by: darkness on July 06, 2017, 10:31:13 PM
Some pictures for Creating New Virtual Machine:
http://imgur.com/uoMR3kz
http://imgur.com/foTVzqY
http://imgur.com/CBbTclv
http://imgur.com/QhFN7ki
http://imgur.com/bOrkRC9
May be I will remove the option for the Root Password and the Root Password will be the same as the User Password. What do you think? Is it going to be better? To login to CWP and VM with the same password?
Title: Re: OpenVZ with CWP
Post by: robbyq on July 07, 2017, 08:27:26 AM
Some pictures for Creating New Virtual Machine:
http://imgur.com/uoMR3kz
http://imgur.com/foTVzqY
http://imgur.com/CBbTclv
http://imgur.com/QhFN7ki
http://imgur.com/bOrkRC9
May be I will remove the option for the Root Password and the Root Password will be the same as the User Password. What do you think? Is it going to be better? To login to CWP and VM with the same password?

i learn all post and this is very good for cwp panel.

i want to try this.
maybe u need go to tutorials created for allways see in one video if u can.

Quote
Administrator
maybe talk with administrator for created this plugins for CWP and pay for this plugins (3$ for exampel and administrator chose % for money and u darkness other)

This plugins for one dedicated can created money and we (administrator and you) can earned with donations of for this plugins.

This is for all works u work for created this plugins / module for CWP.

Sorry my bad english.

And in ur questions
"May be I will remove the option for the Root Password and the Root Password will be the same as the User Password. What do you think? Is it going to be better? To login to CWP and VM with the same password?"

Maybe u said good, first time can created passwords same User (Username123|Username123) or same this is easy for all users after we can change if dont like the pass.
Title: Re: OpenVZ with CWP
Post by: darkness on July 07, 2017, 11:41:52 AM
robbyq I didn`t understand about this $3 and % you were talking about.
by the way everybody can change his root password after logging in the VM with simple command "passwd".
so, yeah. I will remove the "Root Password".
I`m still thinking how to make the single ports -> to be random generated from 40000 to 65535 or the admin to choose/write it manual. Even from 60000 to 65535 is too much for a single server to handle this much VMs. I think that 2000 ports will be more than enough for a single server to be reserved for VMs. Also there are few more config options which I still don`t know how will be better to make them. And the downloader - to download all available OpenVZ templates or the administrator to download the templates manually and from there to short the list of available OSs that users can choose. For the moment the Downloader is downloading all available which I found in google after 2 weeks deep search for templates. At the moment there are 61 distributions, but most of them are different versions of the same Linux. I was wondering to cut the oldest ones and to leave just the last releases, but like this the admin can`t offer VPS with 128MB RAM for example and that`s why I left them.
Sorry for the delay with the panel but I have my other business to care about, my garden, my bees, now I`m making full renovation of the house alone, MY FAMILY and tomorrow I`m waiting guests from NY. It`s hard to find 1 hour of free time to work on it. Mostly after 2AM and 6AM I got to start other work again. But the admin part is almost done. Soon can be released for testing and if the tests pass without any errors I can give it for release. Then I can start with the Client part.
Title: Re: OpenVZ with CWP
Post by: darkness on July 07, 2017, 08:03:18 PM
So again I am away from the developing machine and again I forgot to setup my routers to have access to it. Good that I got another server here, so I can start to work on the client panel here and later to merge them.
Title: Re: OpenVZ with CWP
Post by: darkness on July 15, 2017, 09:46:37 PM
Hello people,
I just got an unexpected travel to Hungary on wednesday for around 10 days. I will take all I need with me and make myself access to the developing machine, but since I got an important job there I will use any free minute to continue developing the module. This will again expand in time the release, but I have no choice. Please excuse me for that.
Title: Re: OpenVZ with CWP
Post by: darkness on July 20, 2017, 06:44:50 PM
Hello guys,
Everything was going ok up to now. Now I headbanged with a problem with executing a shell command through php with so many variables. As of bash documentation "var=${1}...${255}", but ... something goes wrong when sending all the needed variables to the bash script. If anybody got any (advanced) skills in bash I will be very thankful for the help or the release time will be extended again until I find the way to fix it. The other way is to rewrite half of the source code in php and to write like 60 bash files each one to be ready for each OS with specific options like 512M ram, 1G swap, 5G disk space and to send only 3-4 variables to this script. But I don`t see it as a better decision. Will see. Any help is welcome.
Title: Re: OpenVZ with CWP
Post by: darkness on July 24, 2017, 03:50:07 AM
Ok now. The problem with the bash is fixed and it`s creating new Virtual Machines, now to fix the api call to add new user to CWP.
Note: For good or for bad the module is going to be with a bash installer, because we will need some programs like lshw for example.
Stay tuned.
Title: Re: OpenVZ with CWP
Post by: darkness on July 24, 2017, 09:05:38 PM
Question to Administrator, Igor S. or any other CWP developer:
What it means "Failed to include API File!!!". After executing "curl http://192.168.199.107:2030/api/?key=Ez6T2extKTDx37Ltvcz&api=account_new&domain=example.com&username=testuser&password=testpass&package=1&email=test@born2host.com&inode=10000&nofile=100&nproc=25" I get Failed to include API File!!!. The key is correct, I added all possible IP addresses that I can come out with from the local network + the external IP - It doesn`t seem to be IP problem. Please, decode for me this "Failed to include API File!!!" to be able to continue work on the VPS panel.
Title: Re: OpenVZ with CWP
Post by: darkness on July 25, 2017, 11:35:04 AM
Anyway I fixed it. Everything is working fine. To the admin panel I need to add just some config stuff which is not very important, but it`s working! I tried Fraps, Shadowplay, OBS Studio, but I couldn`t make them work to make a video to see the panel in action. If you know free program for making videos that works on Windows 10 let me know to make a video for you. Stay tuned and I`m starting the work on the client panel.
Title: Re: OpenVZ with CWP
Post by: robbyq on July 25, 2017, 11:47:52 AM
hi, OBS Studio i used and work fine. Need u help for configurations?

can recording and after u can upload youtube or same, and imput url.

If need help u can said me
Title: Re: OpenVZ with CWP
Post by: robbyq on July 25, 2017, 11:49:58 AM
Question to Administrator, Igor S. or any other CWP developer:
What it means "Failed to include API File!!!". After executing "curl http://192.168.199.107:2030/api/?key=Ez6T2extKTDx37Ltvcz&api=account_new&domain=example.com&username=testuser&password=testpass&package=1&email=test@born2host.com&inode=10000&nofile=100&nproc=25" I get Failed to include API File!!!. The key is correct, I added all possible IP addresses that I can come out with from the local network + the external IP - It doesn`t seem to be IP problem. Please, decode for me this "Failed to include API File!!!" to be able to continue work on the VPS panel.

I have same errors:

Quote
Administrator
Quote
Sandeep
Quote
Igor S.
Title: Re: OpenVZ with CWP
Post by: darkness on July 26, 2017, 06:41:22 PM
Here is the first screen shot from the user panel. Hope you will like it:
(http://i.imgur.com/XH7kR6F.png)
Probably from CWP they will want to kill me for something I did but ... I had to! I reversed it back to the same position.
If you want something to be changed/improved feel free to write your opinion and I will do my best to do it if it`s usable.
Title: Re: OpenVZ with CWP
Post by: darkness on July 26, 2017, 09:19:08 PM
(http://i.imgur.com/piqRCpo.png)
It`s going to look something like this, but keep in mind that it will be only 1(one) VM per user. The administrator will not be able to add second VM for the same user, the user need to get/purchase one more account. This is just a demo, so I have them all. Also you will not be able to add the same IP address to another user like I did.
From the button "Manage" the user will be able to perform these actions:
Boot
Shutdown
Reboot
Reinstall
Change Root Password
Change Hostname
The admin can do it from the admin menu with single button click. Poll is coming ... NOW!
Title: Re: OpenVZ with CWP
Post by: robbyq on July 27, 2017, 03:32:31 PM
(http://i.imgur.com/piqRCpo.png)
It`s going to look something like this, but keep in mind that it will be only 1(one) VM per user. The administrator will not be able to add second VM for the same user, the user need to get/purchase one more account. This is just a demo, so I have them all. Also you will not be able to add the same IP address to another user like I did.
From the button "Manage" the user will be able to perform these actions:
Boot
Shutdown
Reboot
Reinstall
Change Root Password
Change Hostname
The admin can do it from the admin menu with single button click. Poll is coming ... NOW!

it so nice. we need contract buy more ips for all vm?
Title: Re: OpenVZ with CWP
Post by: darkness on July 28, 2017, 07:57:54 AM
No. This is a developing machine where I don`t need more IP adresses. It`s the same if you use external IP or internal IP. Iptables are supposed to forward the users connections to defined IP and port. If you have just 1 external IP like 42.71.148.203 and you make a VM on internal IP like 192.168.0.2 with port 62001, when the user tries to connect to 42.71.148.203 on port 62001 iptable should forward him and connect him to 192.168.0.2 on port 62001. Something like apache is doing when you have NAT enabled. The stuff with the iptabes is not tested fully yet. I live on a village and there is my developing machine. I got my internet there through WiFi and I need to call my ISP to open all ports in the antena, so I can open them in the routers in the house for testing. But I`m still reading about iptables how to make good forwarding. I`ve been using FreeBSD for more than 12 years and I got used with pf(packet filter), so now it`s a bit difficult and strange for me to switch to iptables. But I bought a nice 841 page book for iptables and it`s a matter of time to read it and fix it.
Title: Re: OpenVZ with CWP
Post by: darkness on August 01, 2017, 09:53:42 AM
Since I can`t find logo for CCTel Linux I will remove it from the list of the OSs for installation.
Also I`m making some changes on the way both panels looks like. On both of the panels left to do:
Admin panel:
1. Adding IP Addresses to be assigned to VMs (easy job, just need time)
Client panel:
1. Reinstall OS (50%) (easy job, just need time)
2. Change Root Password of a VM (easy job, just need time)
3. Change Hostname of a VM (easy job, just need time)
4. Open Root Console to a VM (hard job, need more time and may be help from a friend)
Some minor fixes on iptables rules and on the way both panels will look like.
Title: Re: OpenVZ with CWP
Post by: darkness on August 02, 2017, 07:30:32 PM
I was watching videos in youtube how to config OBS but it`s still not recording anything but black screen. Take some more pictures instead:
(http://i.imgur.com/wDJCW9r.png)
(http://i.imgur.com/PGm0UWW.png)
(http://i.imgur.com/R25YTMk.png)
(http://i.imgur.com/6fQ5ptN.png)
(http://i.imgur.com/jzBEPpe.png)
(http://i.imgur.com/12pJ7lt.png)
(http://i.imgur.com/4RnsdaV.png)
(http://i.imgur.com/BcfG0Cs.png)
(http://i.imgur.com/Gh9wTN1.png)
(http://i.imgur.com/Gh9wTN1.png)
(http://i.imgur.com/jVOQuiu.png)
(http://i.imgur.com/SUiBCDT.png)
So, this is it for the moment from the client panel. Now I will do the "Change Root Password", "Change Hostname" and may be I will start to work on "Open Root Console". If you don`t like how it looks like or you want me to add something - let me know in the post, on PM, on root@born2host.com or on skype: theworkskype . I`m open for ideas.
Title: Re: OpenVZ with CWP
Post by: darkness on August 03, 2017, 12:14:57 PM
Thanks to robbyq I could make the first video. Here it is:
https://youtu.be/L_f2E5uJvqE
Once again: Thank you robbyq
Title: Re: OpenVZ with CWP
Post by: darkness on August 04, 2017, 05:28:58 AM
I`m going to a quick holiday for 3-4 days on the beach. After I come back I will try all the templates one by one and some of them might be deleted, because as I noticed for example there`s a problem with Gentoo x86 Network with OpenVZ. In the first release the problem templates (if any) will be removed and until the second release I will try to fix them to be able to use them. See you soon guys.
Title: Re: OpenVZ with CWP
Post by: darkness on August 16, 2017, 03:47:22 PM
After few shorts on the electricity because of burning houses here in the village, the HDD of the developing machine burn out. It`s good that I have 3 backups on 3 different places around Europe. Today I bought a new HDD. Now I will install CentOS 6 again and I will continue work.
Stay tuned ...
Title: Re: OpenVZ with CWP
Post by: darkness on August 18, 2017, 06:17:43 PM
I saw that from OpenVZ.org made updates to the templates. Now I`m testing the new templates to be sure they are not for Virtuozzo 7 only and they work on OpenVZ 6 also. For the moment what I see is that all the CentOS 6 versions works ok, and they are upgraded to 6.9 (Final) so when you install a container with CentOS 6, the user don`t need to wait 1h for "yum -y update", but most likely 1-15min depending on your INet connection and your server.
By the way all(2) Gentoo templates will be removed. They are old, no support for them, too much work to fix the networking and ... it sux. ;D
I found a Proxmox release of Gentoo 03/05/2017, but it makes problem with extracting stage3 to the container so it will be dismissed also.
Also got Ubuntu 17.04 - networking problem, OpenSuSE 42.2 - install problem. Got to test Alpine Linux 3.3, 3.4 and 3.5, Arch Linux base from 2017 and if they work will be added to the module.
Stay tuned.
Title: Re: OpenVZ with CWP
Post by: darkness on October 24, 2017, 04:39:30 AM
Hello people,
It`s been a long time since I wrote back here. Many of the new templates are not working with the old OpenVZ 6, so we will stick on the old ones. For sure I can say that the module is 91% ready, tested and working. Still got no success with the Console from CWP6.user to every single VM. At the moment I`m experimenting with noVNC which gives me some power. As of this point it`s going good, but still having some issues implementing it. Hope soon to be 100% ready. Stay tuned.
Title: Re: OpenVZ with CWP
Post by: Gogo on October 24, 2017, 02:10:16 PM
First I want to say nice job done here mate.

And second I notice in your first post here that you are reading .my.cnf file directly but you don't have to do that.
You probably know that, but I just want to tip you an a much faster way to do that.

Got some strange problem on the admin panel:
Code: [Select]
$root_file = "/root/.my.cnf"; -> From which file to get mysql password

Just use this vars from CWP itself
Code: [Select]
$db_host , $db_user , $db_pass , $db_name
But if you still want to read cnf file you can use parse_ini_file() (https://secure.php.net/manual/en/function.parse-ini-file.php) function instead of explode and bypass problems with line breaks and spaces that can happen while exploding lines from files:
Code: [Select]
$dbFile = parse_ini_file('/root/.my.cnf');
$sql = new mysqli('localhost', $dbFile['user'], $dbFile['password'], 'root_cwp');

Just a small tip. :) Keep going mate.
Title: Re: OpenVZ with CWP
Post by: darkness on October 25, 2017, 04:34:18 PM
Long time ago I stopped trying to get password from .my.cnf and start using db_conn.php :) Now I`m banging my head on the wall with noVNC. But somehow I will make it work. Some day ... If anyone can help with noVNC ...
Title: Re: OpenVZ with CWP
Post by: Gogo on October 25, 2017, 09:14:06 PM
What's the problem with noVNC?
Title: Re: OpenVZ with CWP
Post by: darkness on October 26, 2017, 04:17:25 AM
I create the VM through the web control. In the same time the shell script is creating the VM and adding iptables rule:
Code: [Select]
iptables -t nat -A PREROUTING -i $eth -p tcp --dport $port -j DNAT --to-destination $ipaddr:$inport
iptables -t nat -A POSTROUTING -o $eth -j MASQUERADE
Where $port is starting from 62000 and finishes to 65000 and $inport normally is 22 for SSH. As I follow the instructions for integration of noVNC I start it with username and this command:
Code: [Select]
websockify -D --web=/usr/share/novnc/ --cert=/etc/pki/tls/certs/novnc.pem 6080 $ipaddr:$inport
Where 6080 is the web port for accessing noVNC. Meantime the script is creating the vnc/xauth config when creating the VM. But when I try to access the VM through noVNC I got error 1006 and connection fails. If I start it with "websockify -D --web=/usr/share/novnc/ --cert=/etc/pki/tls/certs/novnc.pem 6080 localhost:5901" it`s making connection to the CentOS (where I don`t have GUI and it shows black screen of course).
The problem is that I can`t make it connect to the VM.
Title: Re: OpenVZ with CWP
Post by: Gogo on October 26, 2017, 02:42:48 PM
You probably found this, if not try it. That was the only thing i found about 1006. If I understand that on github it is firewall related, like service exists on that port but it is unreachable.
GitHub - Server disconnected (code: 1006) (https://github.com/novnc/noVNC/issues/254)

Code: [Select]
iptables -I INPUT -p tcp --dport 6080 -j ACCEPT; iptables -I OUTPUT -p tcp --dport 6080 -j ACCEPT; service iptables save
Did you get any more specific output from
Code: [Select]
websockify -D --web=/usr/share/novnc/ --cert=/etc/pki/tls/certs/novnc.pem 6080 $ipaddr:$inportAnd did you check these 2 vars $ipaddr and $inport if they returns valid values?
Title: Re: OpenVZ with CWP
Post by: darkness on October 26, 2017, 05:01:54 PM
Here is the output:
Code: [Select]
[dlkarakashev@cwp vm]$ websockify -D --web=/usr/share/novnc/ --cert=/etc/pki/tls/certs/novnc.pem 6080 192.168.199.113:62000
WebSocket server settings:
  - Listen on :6080
  - Flash security policy server
  - Web server. Web root: /usr/share/novnc
  - SSL/TLS support
  - Backgrounding (daemon)
[dlkarakashev@cwp vm]$
How it have to be. And yes, $ipaddr and $inport return correct values. But as I see there`s a little problem with networking of VMs.
Code: [Select]
[root@born2host /]# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1416 (1.3 KiB)  TX bytes:1416 (1.3 KiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:272 (272.0 b)  TX bytes:200 (200.0 b)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:192.168.199.113  P-t-P:192.168.199.113  Bcast:192.168.199.113  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

[root@born2host /]# ping google.com
ping: unknown host google.com
I will see what`s going on with the network and I will write to you again.
Title: Re: OpenVZ with CWP
Post by: Gogo on October 26, 2017, 06:25:01 PM
Unknown host can be problem with resolver, but also it can be related to something else with network. :/

What do you get by executing this?
Code: [Select]
cat /etc/sysconfig/network-scripts/ifcfg-venet0
Code: [Select]
cat /etc/sysconfig/network-scripts/ifcfg-venet0:0
Title: Re: OpenVZ with CWP
Post by: darkness on October 26, 2017, 07:20:29 PM
Looking for BETA testers with dedicated servers. Better NOT to be behind a router and all the ports to be open. Also will be very good if you have atleast 2 public IP addresses and NOT behind NAT. Write to me on PM.
Title: Re: OpenVZ with CWP
Post by: darkness on December 02, 2017, 05:19:56 PM
This module will never be finished like the module for CWP7. The module to control Proxmox + other modules will be kept just for me. That`s it. Have fun and say thanks to the owners and devels of CWP.
Title: Re: OpenVZ with CWP
Post by: OnlyHard on April 02, 2018, 04:51:07 PM
Hello everyone! I see huge potential in this "exprimental-addon" someone could share the Sorce of the files in GuiHub for example we can all work on this tool / technology! it looks like immense technologies never seen before in this panel, since some of the tools were developed by users! Since a lot of work has already been done ... Together we can evolve.
I will be grateful that someone can respond to this topic!
Thanks in advance
Title: Re: OpenVZ with CWP
Post by: darkness on April 22, 2018, 08:38:25 PM
I got it ready and working on 99%. The only thing that made a mess was the noVNC and there I left it since more than 20k+ lines of codes the owners and the devels didn`t pay any attention and didn`t help at all. That`s why I get angry and I closed the project.
Title: Re: OpenVZ with CWP
Post by: Dexxa on March 15, 2020, 10:12:28 PM
Thats a shame :-( Looked a good project, Would of been an amazing addon for the centos web panel community, If i knew how to code i would help out but sadly i dont know how to code. I would of loved to have tested it for you,

I got it ready and working on 99%. The only thing that made a mess was the noVNC and there I left it since more than 20k+ lines of codes the owners and the devels didn`t pay any attention and didn`t help at all. That`s why I get angry and I closed the project.