sspitfire

Active Member
Mar 5, 2011
28
0
51
so in this :
# /scripts/wwwacct
Please use the following syntax:
wwwacct <domain> <user> <pass> <quota> <cpmod[advanced/?]> <ip[y/n]> <cgi[y/n]> <frontpage[y/n]> <maxftp> <maxsql> <maxpop> <maxlst> <maxsub> <bwlimit> <hasshell[y]/[n]> <owner> <plan> <maxpark> <maxaddon> <featurelist> <contactemail> <use_registered_nameservers> <language>

what is :
<plan>
<featurelist>
<use_registered_nameservers>

can i specify DNS settings ?

do you know of a shell scripts that will add multiple accounts?
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
San Francisco, CA
cPanel Access Level
Root Administrator
what is :
<plan>
plan is the package to use when creating the account

<featurelist>
This is the name of a feature list (optional as it is defined by plan). See 'Feature Manager' in WHM to find their names.

<use_registered_nameservers>
This will create the DNS with the nameservers specified at the domain registrar rather than the nameservers configured in WHM.

can i specify DNS settings ?
No. This must be done via the DNS functions in the cPanel API. You can find the PHP class to access the API here:

https://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php

You'll either want:
public function addzonerecord( $zone, $args )

or

public function editzonerecord( $zone, $line, $args )

do you know of a shell scripts that will add multiple accounts?
Here's an example of a PHP script that creates a single account. You could modify it to accept a CSV as input and add a loop to create all the accounts:

https://github.com/CpanelInc/xmlapi-php/blob/master/Examples/createacct_example.php
 

sspitfire

Active Member
Mar 5, 2011
28
0
51
i dont want to use a plan - so do i put "n" as an argument or just skip it ?

I dont want to use any feature lists - what would the argument for this be - disabled, default or "n" ?

I need to use the local NS in WHM - do i skip <use_registered_nameservers> or do I put "n"?

I actually dont need to add or edit a zone record - I just need to enable SPF and DKIM when creating the account. So how can I do this ?
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
San Francisco, CA
cPanel Access Level
Root Administrator
i dont want to use a plan - so do i put "n" as an argument or just skip it ?
You can only skip an argument if there are no arguments after it because otherwise the script will just pull in the next argument thinking it is for plan. Why do you not want to use a plan? Setting the values for disk space, bandwidth, sub domains, etc in a plan will allow you to keep easy visual tabs on what customers have what resources available as well as modify multiple accounts if you decide to change what service levels you offer.

I dont want to use any feature lists - what would the argument for this be - disabled, default or "n" ?
This seems odd. What happens if you find out that customers are confused by a certain feature or you don't want to offer a feature? With a feature list, you can turn that feature off once and it will disappear from all account with that list.

I need to use the local NS in WHM - do i skip <use_registered_nameservers> or do I put "n"?
Using the WHM name servers is the default option. Use 0 to turn off use_registered_nameservers

I actually dont need to add or edit a zone record - I just need to enable SPF and DKIM when creating the account. So how can I do this ?
Under 'Tweak Settings' >> 'Domains' in WHM, you need to set this option to 'on':

Enable SPF on domains for newly created accounts

DKIM should be on by default but can be set in the same location if it is not.
 

sspitfire

Active Member
Mar 5, 2011
28
0
51
Thanks for the reply. My problem now is its always creating the account on the same IP. Im putting "y" on the IP option which means "dedicated IP: yes" correct ? How can I create each account on a different IP ? this is my command:
"/scripts/wwwacct test5.domain.com niks userpass 100 0 y y y 5 5 5 5 5 100 n"
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
San Francisco, CA
cPanel Access Level
Root Administrator
Thanks for the reply. My problem now is its always creating the account on the same IP. Im putting "y" on the IP option which means "dedicated IP: yes" correct ? How can I create each account on a different IP ? this is my command:
"/scripts/wwwacct test5.domain.com niks userpass 100 0 y y y 5 5 5 5 5 100 n"
IP=y should assign the account to the next available IP on the system. You'll need to make sure that you haven't reserved the IPs.

You can check to see if there are any IPs left in the available pool with:

Code:
#cat /etc/ipaddrpool
 

sspitfire

Active Member
Mar 5, 2011
28
0
51
IP=y should assign the account to the next available IP on the system. You'll need to make sure that you haven't reserved the IPs.

You can check to see if there are any IPs left in the available pool with:

Code:
#cat /etc/ipaddrpool
Im having problems again . IP=y is set but its creating them all on the same IP . I have free unreserved IPs in ipaddrpool. how do I make it choose a different IP forevery new account?
 

MilesWeb

Well-Known Member
PartnerNOC
May 23, 2012
173
2
68
India
cPanel Access Level
Root Administrator
Twitter
Find for ADDR in /etc/wwwacct.conf. It will show a default IP. When you create an account, it creates the account and uses this IP. Change the IP in this file and then create the account. Every account you create will be assigned with the IP defined in the file /etc/wwwacct.conf
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
14
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Im having problems again . IP=y is set but its creating them all on the same IP . I have free unreserved IPs in ipaddrpool. how do I make it choose a different IP forevery new account?
What is the full version number of cPanel&WHM that is installed where you're experiencing the issue with IP address assignment during command-line account creation? To find your version, you may input the following via command-line as root, then copy-and-paste the output:
Code:
cat /usr/local/cpanel/version
I believe this might be related to internal case 97277 and ask for your specific cPane&WHM version number to help gather more information. Thank you! :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Internal case number 97277 is addressed in cPanel version 11.42.1.15, but that build was only released on 2014-05-13 (after you first reported the issue). Could you verify if the issue persists at this time?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I am happy to see the issue is resolved. Thanks for updating us with the outcome.