Hello There, Guest! Register

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Virtualmin for TheHostingTool
04-03-2012, 06:45 AM, (This post was last modified: 06-01-2013, 10:53 PM by Liam D..)
Virtualmin for TheHostingTool
Following my successful release of the Kloxo Server Plugin, I am now releasing my next server plugin, the Virtualmin Server Plugin. This utilizes the API of the Virtualmin Panel via JSON.


You need to run a few commands on your VIRTUALMIN server via SSH. These will install Perl modules on the server that will make the plugin function. Run the following commands one-by-one via SSH:
yum -y -d 2 install gcc make g++ gcc-c++ bison unzip which mlocate perl
cd /usr/src
wget http://dl.dropbox.com/u/9823273/json-pp.tar.gz
tar xfvz json-pp.tar.gz
rm -f json-pp.tar.gz
cd JSON*
chmod +x Makefile.PL
perl Makefile.PL
make install

That will install the JSON :: PP Perl Module, as it is not installed with a default installation. Please note that the instructions above are only tested on CentOS v5 and v6. Installations on other distros require different commands, especially for installing the required compilers.

Update (May 5th, 2012): All installations should run the validation script first before asking for support. This is to ensure that common problems were not encountered, thus providing faster support because obvious problems were not found.

Please download the validation script (validate.php) at the attachments. To install the server validation script, upload it in the root of your THT installation. If you installed THT in http://whatever.com/tht/ then the script should be in http://whatever.com/tht/validate.php -- once you uploaded it, visit it in your browser.


Upload virtualmin.php to your /<path_to_tht>/includes/servers/ directory and add the server from within the Admin CP. Upload validate.php to /<path_to_tht>/ and run http://<url_to_tht_main>/validate.php -- DO NOT UPLOAD validate.php TO THE SERVERS DIRECTORY.


After installing (see above) the plugin, go to the ACP > Servers > Add Server. Select Virtualmin from the drop box. Then, for user, put in the username and password that has privileges to create new accounts. Like, root. Do not worry, the script does NOT send me your server root passes, you can even check for yourself.

Version History
Current Version: v2.04 (May 8, 2012)
Old Version: v1.0.0 (April 3, 2012)


- This uses cURL, so make sure cURL is enabled.
- This connects to Virtualmin through SSL by default. There is no way to change this except to modify the code.
- This is ONLY TESTED ON VIRTUALMIN GPL. Therefore, this plugin does NOT support resellers. If you have a copy of Virtualmin PRO that DOES support resellers, please feel free to modify the code. Again, VIRTUALMIN GPL DOES NOT SUPPORT RESELLERS.
- As of version 2.04, this script follows a new versioning system.
- As of version 2.04, this script no longer verifies the SSL peer.

Attached Files
.zip   Virtualmin.zip (Size: 2.89 KB / Downloads: 489)
Remote Servers - Shared, Reseller & KVM Hosting Services
04-24-2012, 08:19 AM,
RE: Virtualmin for TheHostingTool
I installed json-pp, curl is enabled. In 'add server' put details for root account. In 'add package' as backend name put 'Default Plan' from Virtualmin>System settings>Account plans.
I passed every 5 steps and get information then account was created but in Virtualmin it isn't added.
What did I do wrong?
04-30-2012, 03:43 PM,
RE: Virtualmin for TheHostingTool
I add
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

Now account is created on Virtualmin but THT still loadnig and loadnig. Does not inform about succesfully created account.
05-03-2012, 02:31 AM,
RE: Virtualmin for TheHostingTool
Mhm, maybe you had a PHP timeout? Not sure, since I'm no longer working with a server. Can anyone verify this?
Remote Servers - Shared, Reseller & KVM Hosting Services
05-03-2012, 08:00 AM,
RE: Virtualmin for TheHostingTool
Increase maximum execution time from 30 to 60 without no effect.
05-03-2012, 01:26 PM,
RE: Virtualmin for TheHostingTool
Please note that this is a tutorial specifically for CentOS and similar Linux distributions. Setup will be slightly different on distros like Debian and Ubuntu.
Kevin Mark - TheHostingTool Lead Developer
05-03-2012, 05:48 PM,
RE: Virtualmin for TheHostingTool
Setup on Debian is almost the same. Only some packages need install manually like mod perl, curl.

So need different setup instructions for THT on Debian with Virtualmin because php-gd is not installed and captcha doesn't work?

Requirements should be sufficient Wink
05-04-2012, 01:09 AM, (This post was last modified: 05-04-2012, 01:09 AM by Liam D..)
RE: Virtualmin for TheHostingTool
+1 to what Kevin said. I forgot to mention that this setup is for CentOS. I forgot that Virtualmin runs on others as well.

I don't feel very comfortable using Debian as a server, so I stick to CentOS. It's just easier to manage packages there. For Debian, I don't know what goes wrong, but it works on my CentOS-based server. Maybe because Debian/Ubuntu's PHP package has a built-in suhosin extension which cannot be disabled (I had a client once that had Ubuntu + PHP, took me weeks to give up eventually) is why it won't work.
Remote Servers - Shared, Reseller & KVM Hosting Services
05-04-2012, 03:53 AM, (This post was last modified: 05-04-2012, 04:04 AM by kamilel.)
RE: Virtualmin for TheHostingTool
I use only Centos with Virtualmin. Centos 6.2 and I have still problem with info about created account. I have not suhosin.
There is my php.ini

Liam I can get you pass to my test server i you want invastigate it
05-04-2012, 12:41 PM, (This post was last modified: 05-04-2012, 12:43 PM by Liam D..)
RE: Virtualmin for TheHostingTool
I do not provide this kind of support. I only do support for my scripts if it's just a small issue/bug fix. I do not do server inspections.
Remote Servers - Shared, Reseller & KVM Hosting Services

Forum Jump:

Users browsing this thread: 1 Guest(s)