New ISPConfig module for WHMCS

Discussion in 'Tips/Tricks/Mods' started by cwispy, Dec 11, 2014.

  1. cwispy

    cwispy Active Member

    Edit the web creation section and add this line.
    "'nginx_directives' => '',"

    So ithat section will end up liooking like this.

    Code:
    if ( $webcreation == 'on' ) {
    $ispcparams = array(
    'server_id' => $defaultwebserver,
    'ip_address' => '*',
    'domain' => $domain,
    'type' => 'vhost',
    'parent_domain_id' => '0',
    'vhost_type' => 'name',
    'hd_quota' => $webquota,
    'traffic_quota' => $webtraffic,
    'cgi' => $enablecgi,
    'ssi' => $enablessi,
    'perl' => $enableperl,
    'ruby' => $enableruby,
    'python' => $enablepython,
    'suexec' => $enablesuexec,
    'errordocs' => $enableerrdocs,
    'is_subdomainwww' => 1,
    'subdomain' => $subdomain,
    'php' => $phpmode,
    'ruby' => $enableruby,
    'redirect_type' => '',
    'redirect_path' => '',
    'ssl' => $enablessl,
    'ssl_letsencrypt' =>$enablessletsencrypt,
    'ssl_state' => '',
    'ssl_locality' => '',
    'ssl_organisation' => '',
    'ssl_organisation_unit' => '',
    'ssl_country' => '',
    'ssl_domain' => '',
    'ssl_request' => '',
    'ssl_key' => '',
    'ssl_cert' => '',
    'ssl_bundle' => '',
    'ssl_action' => '',
    'stats_password' => $password,
    'stats_type' => 'webalizer',
    'allow_override' => 'All',
    'php_open_basedir' => '/',
    'php_fpm_use_socket' => 'y',
    'pm' => 'dynamic',
    'pm_max_children' => '10',
    'pm_start_servers' => '2',
    'pm_min_spare_servers' => '1',
    'pm_max_spare_servers' => '5',
    'pm_process_idle_timeout' => '10',
    'pm_max_requests' => '0',
    'custom_php_ini' => '',
    'nginx_directives' => '',
    'backup_interval' => '',
    'backup_copies' => 1,
    'active' => $webactive,
    'traffic_quota_lock' => 'n',
    'added_date' => date("Y-m-d"),
    'added_by' => $soapuser
    );
    
     
    AVG likes this.
  2. cwispy

    cwispy Active Member

    Does anything get created in your named.conf.local file?
    What do you have in your dns template file in Ispconfig?
     
  3. AVG

    AVG Member

    Hello cwispy, i have added nginx directive in web creation section, and is working now.
    Thank you very much.
     
  4. AVG

    AVG Member

    And i have the same problem with DNS creation as romlaum.
    In ISPconfig DNS template i have this:
    [ZONE]
    origin={DOMAIN}.
    ns={NS1}.
    mbox={EMAIL}.
    refresh=7200
    retry=540
    expire=604800
    minimum=3600
    ttl=3600

    [DNS_RECORDS]
    A|{DOMAIN}.|{IP}|0|3600
    A|www|{IP}|0|3600
    A|mail|{IP}|0|3600
    NS|{DOMAIN}.|{NS1}.|0|3600
    NS|{DOMAIN}.|{NS2}.|0|3600
    MX|{DOMAIN}.|mail.{DOMAIN}.|10|3600
    TXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600

    In ISPconfig database in table dns_rr i see there is new created domain dns records, but server id is 0, but others dns records of others domains have server id 4, server id 4 in my combination is dns server, but why in new created domain i have server id 0.
    I think this is the trouble why new DNS records is not created in DNS server.


    Module log from whmcs:

    A have renamed my actual ip address with MY IP ADDRESS, and url with MY URL.

    =======================================================
    creatednsmx = Request = 1021 = Response =

    Array
    (
    [server_id] =>
    [zone] =>
    [name] => zapert.com.
    [type] => mx
    [data] => mail.MY URL.com.
    [aux] => 0
    [ttl] => 3600
    [active] => y
    [stamp] => 2016-10-05 00:06:08
    [serial] =>
    )

    =========================================================
    =========================================================
    creatednscname = Request = 1020 = Response =
    Array
    (
    [server_id] =>
    [zone] =>
    [name] => www
    [type] => CNAME
    [data] => zapert.com.
    [aux] => 0
    [ttl] => 3600
    [active] => y
    [stamp] => 2016-10-05 00:06:08
    [serial] =>
    )

    ===========================================================
    ===========================================================
    creatednsa = Request = 1019 = Response =
    Array
    (
    [server_id] =>
    [zone] =>
    [name] => zapert.com.
    [type] => A
    [data] => MY IP ADDRESS
    [aux] => 0
    [ttl] => 3600
    [active] => y
    [stamp] => 2016-10-05 00:06:08
    [serial] =>
    )


    ============================================================
    ============================================================
    creatednsa = Request = (empty field) = Response =
    Array
    (
    [0] => MY IP ADDRESS
    [ipaddress] => MY IP ADDRESS
    )
    ============================================================

    creatednszone = Request = zapert.com = Response = DNS Template 1

    ============================================================
     
    Last edited: Oct 4, 2016
  5. cwispy

    cwispy Active Member

    Hi AVG,
    Are you using Bind or PowerDNS?
    cwispy
     
  6. AVG

    AVG Member

    Hi cwispy,
    I'm using Bind.
     
  7. alex_xwire

    alex_xwire New Member

    Hi Cwispy,
    Now that ISPConfig 3.1 has been released can your module now create multiple sites per user?
    Thanks,
    Alex
     
  8. cwispy

    cwispy Active Member

    Ok, looks like its a bug related to those using bind. I will have to setup a test server with Bind to test and try to locate the issue.
     
  9. cwispy

    cwispy Active Member

    No not yet.
     
  10. AVG

    AVG Member

    OK, if there will be news, please let know
    Thank you for your help.
     
  11. biforme

    biforme Member

    Hi Cwispy,
    I have setup the creation of ssh user and work fine, now I'm searching to create also db user and db, but something is wrong.
    This is what I write for ispconfig 3.0.5.4p8:

    ---------------------------------------------------------------------
    'Create DB User Account' => array(
    'Type' => 'yesno',
    'Description' => 'Tick to create the DB Accounts '
    )
    ---------------------------------------------------------------------
    $adddbuser = $params['configoption25'];
    ---------------------------------------------------------------------
    // Create DB user and Database
    if ( $adddbuser == 'on' ) {
    $domain_arr = $client->sites_web_domain_get( $session_id, $website_id );
    $ispcparams = array(
    'server_id' => $defaultwebserver,
    'username' => $username . '_db',
    'password' => $password
    );


    $database_user_add_id = $client->sites_database_user_add( $session_id, $client_id, $ispcparams );
    logModuleCall('ispconfig','CreateDatabaseUser',$database_user_add_id,$ispcparams,'','');
    $domain_arr = $client->sites_database_add( $session_id, $website_id );

    $ispcparams = array(
    'server_id' => $defaultdbserver,
    'parent_domain_id' => $website_id,
    'type' => 'mysql',
    'database_name' => $username . '_store',
    'database_user_id' => $client_id,
    'database_ro_user_id' => '0',
    'database_charset' => 'UTF8',
    'remote_access' => 'n',
    'remote_ips' => '',
    'backup_interval' => 'daily',
    'backup_copies' => '5',
    'active' => 'y'
    );

    $database_add_db_id = $client->sites_database_add( $session_id, $client_id, $ispcparams );

    logModuleCall('ispconfig','CreateDatabase',$database_add_db_id,$ispcparams,'','');
    }
    In module setting there are no way to activate the creation. This image after check and save the option.
    [​IMG]
    Thanks in advance if anyone che help me.
     
    Last edited: Oct 21, 2016
  12. boldbesusiax

    boldbesusiax New Member

    Off the top of my head WHMCS only supports 24 config options for provisioning modules, you will have to sacrifice something else to have a database auto-create function.

    On a completely different note, has anybody figured out the issues with BIND and zone creation?
     
  13. AVG

    AVG Member

    Hello cwispy, when i'm creating DNS zone and DNS records manuali from ISPConfig, everything is working fine, DNS zone and DNS records are creating.
    But thru WHMC, DNS zone is not created at all.
     
  14. cwispy

    cwispy Active Member

    Just added a fix for the auto login link from whmcs for ISPConfig 3.1.
    change these lines
    - url: "'.$soapsvrurl.'/content.php",
    - data: "s_mod=login&s_pg=index&username='.$params['username'].'&passwort='.$params['password'].'",

    + url: "'.$soapsvrurl.'/login/index.php",
    + data: "s_mod=login&s_pg=index&username='.$params['username'].'&password='.$params['password'].'",
     
    Thaddeus and webguyz like this.
  15. radim_h

    radim_h Member HowtoForge Supporter

    Hello,
    whe i try create account in ISPC, i'm gettign error in WHMCS
    Module Command Error
    SOAP Error: Column 'nginx_directives' cannot be null INSERT INTO `web_domain` (`server_id`, `ip_address`, `ipv6_address`, `domain`, `type`, `parent_domain_id`, `vhost_type`, `hd_quota`, `traffic_quota`, `cgi`, `ssi`, `suexec`, `errordocs`, `subdomain`, `ssl`, `ssl_letsencrypt`, `php`, `fastcgi_php_version`, `perl`, `ruby`, `python`, `enable_pagespeed`, `active`, `web_folder`, `redirect_type`, `redirect_path`, `seo_redirect`, `rewrite_rules`, `rewrite_to_https`, `ssl_state`, `ssl_locality`, `ssl_organisation`, `ssl_organisation_unit`, `ssl_country`, `ssl_domain`, `ssl_key`, `ssl_request`, `ssl_cert`, `ssl_bundle`, `ssl_action`, `enable_spdy`, `stats_password`, `stats_type`, `backup_interval`, `backup_copies`, `backup_excludes`, `document_root`, `system_user`, `system_group`, `allow_override`, `php_fpm_use_socket`, `pm`, `pm_max_children`, `pm_start_servers`, `pm_min_spare_servers`, `pm_max_spare_servers`, `pm_process_idle_timeout`, `pm_max_requests`, `php_open_basedir`, `custom_php_ini`, `apache_directives`, `nginx_directives`, `proxy_directives`, `added_date`, `added_by`, `http_port`, `https_port`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`) VALUES ('5', '*', '', 'adelazrzava.com', 'vhost', '0', 'name', '2000', '-1', 'n', 'n', 'y', '1', '*', 'y', 'n', 'fast-cgi', '', 'n', 'y', 'n', 'n', 'y', '', '', '', '', NULL, 'n', '', '', '', '', '', '', '', '', '', '', '', 'n', '$1$Qib9dBab$u3jjdHBZ5mlt5uR/wFQYC.', 'awstats', '', '1', '', '-', '-', '-', 'All', 'y', 'dynamic', '10', '2', '1', '5', '10', '0', '/', '', NULL, NULL, NULL, '2016-11-10', 'whmcs', '80', '443', '275', '275', 'riud', 'riud', '')

    There is only client created in WHMCS, noithing else. nginx_directives is confusing me, there is no such setting in the module or ISPC limit ?

    Thank you for help

    RH
     
  16. cwispy

    cwispy Active Member

  17. AVG

    AVG Member

    Hello cwispy, is there any news about DNS creation on BIND servers ?
     
    Aivaras likes this.
  18. spido

    spido Member

    I also expect this module to make it work with BIND.
    I can pay for this module in the range of 20-30 euros.
    Please correct module to make it work with BIND.
     
    eisukulu likes this.
  19. Honza

    Honza Member

    Hi guys I'm sorry for de-railing your thread but you all seem to be running WHCMS without issues on ISPConfig and I'm just unable to do so - would anyone of you be so kind and lookup my thread here? https://www.howtoforge.com/community/threads/whmcs-migration-issues.74900/

    I'm afraid I exhausted my options and till recommended to ask here.

    Thank you guys in advance.
     
  20. Aivaras

    Aivaras Member

    For ISPConfig version3.0.., DNS records created perfect, but For 3.1. DNS do not created at all. can someone help me? Im serching problem jut few months...
     
    Last edited: Dec 13, 2016

Share This Page