Go Back   SolidHost Forums Support Forums Control Panel Questions

Reply
 
Thread Tools Display Modes
Old Mar 27th, 2005, 00:50   #1
vista
Customer
 
Join Date: Mar 2005
Posts: 25
Default Creating Reseller Accounts

I've almost finished writing a little script for myself to automatically create cpanel hosting accounts upon client payment. This is really just a little project to do rather than something i'm likely to implement. Still i realised i missed something out, automatically creating resellers (i realise i can't do this without root, as i said more of 'something to do' than something i'm gonna use )

As i don't have root i'm not sure what the process of creating resellers actually is and was wondering if one of the staff (or a customer with a dedi server) could give me an idea.

I've read on the whm docs that you can create a user and add reseller privileges then edit those privileges but i assume there must be some sort of short cut. Can you create 'ready made' reseller packages like you can create plans for normal accounts in WHM?

Also how does the initial setup work? Do you create a small account 'normal' account then add reseller abilities and create their reselling space and bandwidth, or can you just create a normal account with the desired resources and then add reseller privileges and they can resell what u gave them?

As u can guess i really don't know how it's done

Any info appreciated
vista is offline   Reply With Quote
Old Mar 27th, 2005, 07:50   #2
SH-Andre
SolidHost Crew
 
Join Date: Sep 2001
Posts: 850
Default

This is also something that SolidHost is going to implement in our new billing system (still based on the same backend system as what we have now).

The initial setup works like this: you setup an account the way it's done usually, and there's an option during the creation to make a reseller account of it. Another way to create a reseller account is to first create a normal account (without reseller privileges) and to add reseller privileges later in the "reseller center".

I believe that the cPanel API does not support creation of reseller accounts, as far as I know. However at the other hand: if a reseller account can be created manually, there has to be a way to create it automatically too

It'll be quite hard to create this if you don't actually have an environment to test this in. It may be interesting to get a small VPS solution with cPanel, you have full root access on that so it's perfect to test this.

As far as I know reseller accounts are being created using one of the scripts in the /scripts directory, so I'd suggest to make your script add the reseller privs using the correct script in there. That's only possible if you have root access ofcourse.

Good luck!

-----------------
Andre van Vliet
SolidHost Administrators

Solid as a Rock
SH-Andre is offline   Reply With Quote
Old Mar 27th, 2005, 12:34   #3
vista
Customer
 
Join Date: Mar 2005
Posts: 25
Default

Hi, thanks for reply

Quote:
I believe that the cPanel API does not support creation of reseller accounts, as far as I know. However at the other hand: if a reseller account can be created manually, there has to be a way to create it automatically too
Yep, this is my understanding also, basically you have to code it yourself.

Quote:
Another way to create a reseller account is to first create a normal account (without reseller privileges) and to add reseller privileges later in the "reseller center"
This seems like an easy way to do it, however i don't quite get how the actual diskspace and bandwidth for reselling is assigned - does it simply take the amount that you setup in the normal account and assign that for reselling, or must it be setup separate to the normal account?

Quote:
reseller accounts are being created using one of the scripts in the /scripts directory, so I'd suggest to make your script add the reseller privs using the correct script in there.
Yep that is indeed the way i'm going about it

Quote:
It may be interesting to get a small VPS solution with cPanel, you have full root access on that so it's perfect to test this.
That's an interesting idea, i'm not looking to spend a lot of cash as this isn't that important, i guess if i email sales we may be able to sort something out? If your interested i could share my findings in return for a discount

Thanks for your help
vista is offline   Reply With Quote
Old Mar 27th, 2005, 16:10   #4
Rickie
Customer
 
Join Date: Dec 2004
Location: Edinburgh, Scotland.
Posts: 34
Default

The standard WHM/CPanel 'flow' is create the account and assign permissions, pretty good so far, but I do think a VPS would really be your best bet as you will need more permissions than outside a shared/reseller to get that script to do it's job.

Permissions and access by those scripts will be quite far reaching and you'd have to get them rights as one mistake would possibly go global on the server / VPS.

There are a load of folks looking at new IF's at the moment so go for it and ask for helpers to test
Rickie is offline   Reply With Quote
Old Mar 27th, 2005, 20:17   #5
SH-Andre
SolidHost Crew
 
Join Date: Sep 2001
Posts: 850
Default

Quote:
Originally Posted by vista
This seems like an easy way to do it, however i don't quite get how the actual diskspace and bandwidth for reselling is assigned - does it simply take the amount that you setup in the normal account and assign that for reselling, or must it be setup separate to the normal account?
This must be setup seperately, which is usually done in WHM. I'm not sure what specific script takes care of it, but I'll ask cPanel about this. When I hear back from them I'll post it here.

Quote:
Originally Posted by vista
That's an interesting idea, i'm not looking to spend a lot of cash as this isn't that important, i guess if i email sales we may be able to sort something out? If your interested i could share my findings in return for a discount
For this kind of purposes I'd usually be glad to provide it for free but I'm afraid we can't do that with VPS's and dedicated servers. For each VPS we simply have to deal with an significant amount of costs for licenses (Virtuozzo is quite expensive) and hardware resources. I'm sure you understand

If you need a hand on anything feel free to ask, we're always ready to assist.

-----------------
Andre van Vliet
SolidHost Administrators

Solid as a Rock
SH-Andre is offline   Reply With Quote
Old Mar 27th, 2005, 22:55   #6
vista
Customer
 
Join Date: Mar 2005
Posts: 25
Default

Quote:
I'm not sure what specific script takes care of it, but I'll ask cPanel about this. When I hear back from them I'll post it here.
I think it is /scripts2/editressv but if u find out anything i'd be grateful if you could post it

Quote:
For this kind of purposes I'd usually be glad to provide it for free but I'm afraid we can't do that with VPS's and dedicated servers. For each VPS we simply have to deal with an significant amount of costs for licenses (Virtuozzo is quite expensive) and hardware resources. I'm sure you understand
Yeah, sure i understand - i have emailed sales anyway and i'll see what sort of price you guys can offer and go from there

thanks for your help
vista is offline   Reply With Quote
Old Mar 28th, 2005, 12:31   #7
SH-Andre
SolidHost Crew
 
Join Date: Sep 2001
Posts: 850
Default

cPanel's response:

There is no API for WHM functions. If they want to script them they'll need to have their script submit the WHM forms (including authentication) with a tool like LWP (http://search.cpan.org/~gaas/libwww-...803/lib/LWP.pm)

To get the appropriate data and url they'll need to view the source of the page they want to emulate and act accordingly.


---

So in other words, the possibilities of the scripts in /scripts are limited, but their suggestion should work well though.

-----------------
Andre van Vliet
SolidHost Administrators

Solid as a Rock
SH-Andre is offline   Reply With Quote
Old Mar 28th, 2005, 14:32   #8
vista
Customer
 
Join Date: Mar 2005
Posts: 25
Default

Thanks for asking, i had already assumed what they have written anyway. I have already developed my own system for setting up normal accounts that does not use the accounting module API and have tested it successfully. All i need to do is find out what scripts are utilized in creating a reseller account, which i can get from the source as they suggested. Just need to get hold of a root account now!!
vista is offline   Reply With Quote
Old Mar 30th, 2005, 17:42   #9
vista
Customer
 
Join Date: Mar 2005
Posts: 25
Default

Thanks for the 'special' on the short-term VPS

I nearly have everything sorted out now, however there is one thing i not quite understanding. I have opened a ticket about this if that is ok, but i don't think i'm quite being understood based on the reply (though it is possible i'm simply not making any sense ).

I'll post it here as well in case anyone who visits the forum can help...

The problem is with nameservers and IPs. I have been able to setup a new account in WHM with a unique IP, but when setting up a different account's nameservers (through the reseller center) WHM is auto assigning the same IP i've used before for a different account (i have also noticed that it does not do this if an IP has been used previously for nameservers though).

Is this usual behaviour as it would seem that the IP account is now not using a 'unique' IP?

Would the normal procedure be to setup client nameservers with unique IPs, and if so how can this be done in WHM?

I had a thought that perhaps this is only happening because i only have 2 ips with this VPS system? (remember i'm only testing it out, not actually trying to do it in a production environment).

Thanks in advance if anyone has any thoughts

Last edited by vista; Mar 30th, 2005 at 17:45.
vista is offline   Reply With Quote
Old Mar 30th, 2005, 18:16   #10
SH-Andre
SolidHost Crew
 
Join Date: Sep 2001
Posts: 850
Default

Hi Vista,

I'm not sure who replied to the ticket, but if you can tell me the ticket number I'll take a look at it for you.

What you described is normal, if you assign an IP as dedicated IP to an account, that same IP can still be used as nameserver IP for a completely different account.

The solution is quite simple though. In your script, just make a small database file that remembers what IPs belong to what reseller account. Then make the script assign the IP addresses (for nameservers and for usable IP addresses) for the reseller manually, based on the data in the database. Just don't use the automated IP assignment of WHM

The automated IP assignment will use the next two IPs that have not been used yet for any other nameservers. It doesn't look at whether another account is using it yet, it just looks at the nameserver usage.

Hope that answers your question.

Regards,

-----------------
Andre van Vliet
SolidHost Administrators

Solid as a Rock
SH-Andre is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +2. The time now is 09:09.