Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Virtualmin for TheHostingTool
#1
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.

Pre-Requisites

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:
Code:
yum -y -d 2 install gcc make g++ gcc-c++ bison unzip which mlocate perl
updatedb
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
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.

Installation

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.

Configuration

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)

Notes

- 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: 880)
Remote Servers - Shared, Reseller & KVM Hosting Services
Reply
#2
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?
Reply
#3
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.
Reply
#4
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
Reply
#5
Increase maximum execution time from 30 to 60 without no effect.
Reply
#6
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
Reply
#7
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
Reply
#8
+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
Reply
#9
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
http://pastebin.com/VjtymkfG

Liam I can get you pass to my test server i you want invastigate it
Reply
#10
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)