The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Syntax of /scripts/wwwacct ?

Discussion in 'cPanel Developers' started by sspitfire, Dec 13, 2013.

  1. sspitfire

    sspitfire Active Member

    Joined:
    Mar 5, 2011
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  2. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    plan is the package to use when creating the account

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

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

    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 )

    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
     
  3. sspitfire

    sspitfire Active Member

    Joined:
    Mar 5, 2011
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    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 ?
     
  4. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    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.

    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.

    Using the WHM name servers is the default option. Use 0 to turn off use_registered_nameservers

    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.
     
  5. sspitfire

    sspitfire Active Member

    Joined:
    Mar 5, 2011
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    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"
     
  6. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    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 
    
     
  7. sspitfire

    sspitfire Active Member

    Joined:
    Mar 5, 2011
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Thank you !
     
    #7 sspitfire, Jan 8, 2014
    Last edited: Jan 8, 2014
  8. sspitfire

    sspitfire Active Member

    Joined:
    Mar 5, 2011
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  9. MilesWeb

    MilesWeb Well-Known Member
    PartnerNOC

    Joined:
    May 23, 2012
    Messages:
    174
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    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
     
  10. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    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! :)
     
  11. sspitfire

    sspitfire Active Member

    Joined:
    Mar 5, 2011
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cat /usr/local/cpanel/version

    11.42.1.15
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,734
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  13. sspitfire

    sspitfire Active Member

    Joined:
    Mar 5, 2011
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    The problem is resolved in 11.42.1.16
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,734
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page