New ISPConfig module for WHMCS

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

  1. nokia80

    nokia80 Member

    hi,
    oke on mine server this function wil not work
     
  2. cwispy

    cwispy Active Member

    Do you get an error?
     
  3. nokia80

    nokia80 Member

    No, the username is always an abbreviation of the domain name for example hallo.com allows the user hallocom.

    I would like to be the creation of several services under one acount
     
  4. cwispy

    cwispy Active Member

    That is not possible at this stage due the way WHMCS handles accounts. So every product will be setup as a new customer.
     
  5. S0ft

    S0ft Member HowtoForge Supporter

    anyone that can help me?
    I used to use boxbilling, I am nobato to end at WHMCS
    I have proof in nginx and apache2 in wheezy servers

    I did what it says in the tutorial https://github.com/cwispy/ispcfg3/wiki
    and when you create an order it shows me an error, creates correctly ispconfig3 account but not the order or the DNS

    ERROR
    Code:
    Warning: Missing argument 3 for ModuleCallFunction(), called in /var/www/clients/client0/web1/web/includes/modulefunctions.php on line 0 and defined in /var/www/clients/client0/web1/web/includes/modulefunctions.php on line 0
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      55.5 KB
      Views:
      114
    • 2.jpg
      2.jpg
      File size:
      145.6 KB
      Views:
      115
    • 3.jpg
      3.jpg
      File size:
      55.8 KB
      Views:
      119
    • 4.jpg
      4.jpg
      File size:
      197.8 KB
      Views:
      116
    • 5.jpg
      5.jpg
      File size:
      97 KB
      Views:
      119
    • 6.jpg
      6.jpg
      File size:
      83.9 KB
      Views:
      113
    • 7.jpg
      7.jpg
      File size:
      50.6 KB
      Views:
      111
  6. cwispy

    cwispy Active Member

    Do you only have 1 ispconfig server with web, dns, mail etc?
     
  7. S0ft

    S0ft Member HowtoForge Supporter

  8. cwispy

    cwispy Active Member

    Can you try unchecking the option to create a website and see if it works then?
     
  9. cwispy

    cwispy Active Member

    When you click on the System tab in ISPConfig, is the server name there exactly the same as the server name in WHMCS? They must match exactly.
     
  10. cwispy

    cwispy Active Member

    The problem with loadingjkr's setup was that the server name in ISPConfig and in the servers tab in WHMCS did not match exactly. I will try and improve the documentation to make that fact more clear for those setting it up in the future.
     
  11. S0ft

    S0ft Member HowtoForge Supporter

    tried it on apache2 with suphp works very well

    It creates very well in nginx, dns, ftp, email
    but when active php-fpm the 502 error occurs

    I have a problem with php5-fpm in nginx

    manages to activate normal but boot bad request when active php5-fpm
     

    Attached Files:

  12. cwispy

    cwispy Active Member

  13. S0ft

    S0ft Member HowtoForge Supporter

    the pool is not well generated nginx php5-fpm
    /etc/php5/fpm/pool.d/webX.conf

    /etc/php5/fpm/pool.d/web7.conf
    Code:
    [web7]
    
    listen = 127.0.0.1:9016
    listen.allowed_clients = 127.0.0.1
    
    user = web7
    group = client6
    
    pm = dynamic
    pm.max_children = 10
    pm.max_requests = 0
    
    chdir = /
    
    php_admin_value[open_basedir] = /var/www/clients/client6/web7/web:/var/www/clients/client6/web7/private:/var/www/clients/client6/web7/tmp:/var/www/test1.com/web:/srv/www/test1.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
    php_admin_value[session.save_path] = /var/www/clients/client6/web7/tmp
    php_admin_value[upload_tmp_dir] = /var/www/clients/client6/web7/tmp
    php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i [email protected]"
    

    edit:
    Code:
    pm = dynamic
    pm.max_children = 10
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 5
    pm.max_requests = 0
    service php5-fpm restart


    Estudiseno
     
  14. cwispy

    cwispy Active Member

    Please report that error to the ispconfig team. It is not related the module at all.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Its unlikely that this is an ispconfig error as other applications that use the api are working fine. I guess you might not have tested your whmcs plugin with nginx yet? The api parameters differ for apache and nginx servers, you can see that in the ispconfig interface as well, on nginx systems, you have different options then on apache systems. If you dont pass all parameters to the api and some of the parameters that are required for nginx are missing, then the script will fail to generate the nginx vhost or php-fpm pool. If you want to be sure that your script works with nginx and apache, then pass all values as $params to the website add function that are in the web_domain database table (except of the sys_* columns of course, they hold just the permissions) and then test your plugin with an nginx server. If it does not work as expected, then compare the resulting database record in web_domain table that was created by your plugin ith one that was generated trough the ispconfig api and adjust your api params so that they match the ones that ispconfig uses to create the website.
     
    Last edited: Feb 20, 2015
  16. S0ft

    S0ft Member HowtoForge Supporter

    Add this solved the automatic error in Nginx php5-fpm.
    don't forget to enable php-fpm in ispcfg3 Template (Client and Reseller Templates), I don't know if there is a conflict with another version.
    review please:

    Code:
    $ispcparams = array(
                        'server_id' => $defaultwebserver,
                        'ip_address' => '*',
                        'pm_process_idle_timeout' => '10',
                        'pm_max_requests' => '0',
                        'type' => 'vhost',
                        'vhost_type' => 'name',
                        'domain' => $domain,
                        'hd_quota' => $webquota,
                        'traffic_quota' => $webtraffic,
                        'cgi' => $enablecgi,
                        'ssi' => $enablessi,
                        'ruby' => $enableruby,
                        'suexec' => $enablesuexec,
                        'errordocs' => $enableerrdocs,
                        'subdomain' => $subdomain,
                        'ssl' => $enablessl,
                        'php' => $phpmode,
                        'active' => $webactive,
                        'allow_override' => 'All',
                        'php_open_basedir' => '/'
                    );
    

    Code:
                $ispcparams = array(
                        'server_id' => $defaultwebserver,
                        'ip_address' => '*',
                        'pm_process_idle_timeout' => '10',
                        'pm_max_requests' => '0',
                        'type' => 'vhost',
                        'vhost_type' => 'name',
                        'domain' => $domain,
                        'hd_quota' => $webquota,
                        'traffic_quota' => $webtraffic,
                        'cgi' => $enablecgi,
                        'ssi' => $enablessi,
                        'ruby' => $enableruby,
                        'suexec' => $enablesuexec,
                        'errordocs' => $enableerrdocs,
                        'subdomain' => $subdomain,
                        'ssl' => $enablessl,
                        'php' => $phpmode,
                        'active' => $webactive,
                        'allow_override' => 'All',
                        'php_fpm_use_socket' => 'y',
                        'pm' => 'dynamic',
                        'pm_max_children' => '10',
                        'pm_start_servers' => '2',
                        'pm_min_spare_servers' => '1',
                        'pm_max_spare_servers' => '6',
                        'pm_max_requests' => '5',
                        'added_by' => 'admin',
                        'php_open_basedir' => '/'
                    );
    
    
    service nginx restart
    service php5-fpm restart

    in this way it is arranged on my server nginx with php5-fpm
     
  17. cwispy

    cwispy Active Member

    Thanks for the reply Till. I am not able to test against nginx as I do not run it on any of our servers.

    I have updated the script with the missing $params for the sites_web_domain_add function. Please test the latest update and see if it fixes the issue for you loadingjkr.
     
    till likes this.
  18. S0ft

    S0ft Member HowtoForge Supporter

    the error continues.

    ------------------------------------------------------------------------------------------------------------------------------------------------------

    I put this in the ispcfg3.php
    and the error is solved
    https://www.howtoforge.com/community/threads/new-ispconfig-module-for-whmcs.67824/page-6#post-325746
     
  19. webguyz

    webguyz Active Member HowtoForge Supporter

    cwispy,

    Your script is working great and many thanks. I do have an issue with the DNS setting Zone Ip Addressing. You have to hard code the IP address in the module settings. I think it would make more sense to have that IP address be the IP address of the web server that the account is installed on. So If my server group has 5 webservers and your script chooses server A to put the website on, then the Zone Ip Addressing value should be the IP address of server A.

    Any thoughts on this?
     
  20. cwispy

    cwispy Active Member

    I totally agree with you. I have been thinking about it myself in the last few days. I think I will be able to have the dns entries generated based on the servers that are selected. If I get a chance over the Easter break, I hope to get this done.
     
    budgierless likes this.

Share This Page