Submitted by compserv on Mon, 08/10/2009 - 09:08
I purchased a Virtualmin Pro licence in the hopes of starting an ISP. Is there a webform my users can fill out that can be processed like a script to automatically set up their accounts? The thought of setting up hundreds of accounts manually is horrifying.
Status:
Active
Comments
Submitted by andreychek on Mon, 08/10/2009 - 09:25 Comment #1
Out of the box, there is not. But, there's a few of options for you:
Using the API, you could create a web app that enabled customers to sign up for an account. You can see what all is available to you here by typing "virtualmin" on the command line. There's more details here:
http://www.virtualmin.com/documentation/developer/cli
http://www.virtualmin.com/documentation/developer/http
If you happen to have a list of folks you wish to add, you can batch create Virtual Servers using Add Servers -> Batch Create Servers.
The Virtualmin software doesn't getting into the user billing realm, but tools like WHMCS do. WHMCS provides a number of features, including the ability to have users sign up for any of the account plans you created, and will begin billing them whenever you specify. You can see more info about that here:
http://www.whmcs.com/
Submitted by JamieCameron on Mon, 08/10/2009 - 11:41 Comment #2
Also, by accounts do you mean domains or mailboxes? Because we do have a plugin that allows users to create their own mailboxes in some domain - you can install it with the command :
apt-get install webmin-virtualmin-signup
Then enable it as a feature for your domain on the Edit Virtual Server page. The mailbox signup form can then be accessed at https://yourserver:10000/virtualmin-signup/ , without needing to login.
Submitted by compserv on Mon, 08/10/2009 - 12:00 Comment #3
What is the format for batch create? Can It import csv or mdb files? Does WHMCS interact with virtualmin pro at all?
Thanks!
Submitted by andreychek on Mon, 08/10/2009 - 12:04 Comment #4
Howdy -- well, the format for the import is described on the Batch Import page, but it essentially can import data in text files using this format:
domain:description:password:[username]:[parent-domain]:[ip-address]:[alias-domain]
There's a "Help" link on the page that goes into more detail on the formatting.
As far as WHMCS goes -- it works with both Virtualmin GPL and Pro. They offer a 15 day trial if you'd like to give it a shot.
And we've heard nothing but good things from WHMCS customers, so I we can definitely recommend it.
It would be pretty easy to write a script to take a csv and convert it into the batch format. Though, usually, when I have a lot of users to create and a file containing the data, I'll write a script to call the API directly.
You could wrap the following command up in a for loop in a perl or ruby or python script very easily:
virtualmin create-domain --domain $domainname --pass $random --desc "$description"
And you can add any other options you like...everything in the UI is accessible from the command line. Just use "virtualmin create-domain --help" to get a list of options, or check the API docs Jamie linked.
You'd just set the variables in each iteration of the loop. Most scripting languages have the ability to act on each line in a file as part of a loop, making this kind of thing doable in four or five lines of code. PHP might take ten lines of code, but it's still pretty easy, if you're more familiar with PHP.