problems with remoting examples

Discussion in 'Installation/Configuration' started by saco721, Aug 7, 2013.

  1. saco721

    saco721 Member HowtoForge Supporter

    Hi,

    OS is Debian 5 with ISPConfig 3.03.2, multi-server setup.

    I am trying to add an ftp user using the remoting api. The page I get back is blank on firefox, chrome returns server error. I have added a new remote user with all functions selected, and a new shell user. I have followed the "How To Create Remote API Scripts For ISPConfig 3" how to but I still need help. Could you please tell me where I am going wrong. Here is the script:

    Code:
    <?php
    $params = array( 'server_id'			=> '1',
    							'parent_domain_id'		=> $domain_id,
    							'username'			=> $myusername,
    							'password'			=> $mypassword,
    							'quota_size'			=> '-1',
    							'active'			=> 'y',
    							'uid'				=> 'web'.$domain_id,
    							'gid'				=> 'client'.$client_id,
    							'dir'				=> '/var/www/clients/client'.$client_id.'/web'.$domain_id,
    							'quota_files'			=> '100',
    							'ul_ratio'			=> '-1',
    							'dl_ratio'			=> '200',
    							'ul_bandwidth'			=> '-1',
    							'dl_bandwidth'			=> '100',);
    
    
    $domain_id = $client->sites_ftp_user_add($session_id, $client_id, $params_ftp);
    
    $username = 'shelluser';
    $password = 'shellpassword';
    /*
    $soap_location = 'http://localhost:8080/ispconfig3/interface/web/remote/index.php';
    $soap_uri = 'http://localhost:8080/ispconfig3/interface/web/remote/';
    */
    $soap_location = 'http://localhost:8080/remote/index.php';
    $soap_uri = 'http://localhost:8080/remote/';
    
    //* Logout
    	if($client->logout($session_id)) {
    		echo "FTP Created";
    	}
    	
    } catch (SoapFault $e) {
    	die('SOAP Error: '.$e->getMessage());
    	echo "Please contact the server administator";
    }
    ?>
    
    Thank you for your time!
     
    Last edited: Aug 7, 2013
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Are you sure that you use http for ISPConfig interface and not https?
    If you use https you have to change the soap-urls.

    By the way you should really (really!) update to the newest version of ISPConfig! Yours is completely outdated.
     
  3. saco721

    saco721 Member HowtoForge Supporter

    Hi Croydon,

    Thanks for your response, I am trying to update my ispconfig version as you advised, but am having problems. The update for my master server went fine, its now running version 3.0.5.2. When I try to update the slave servers I get "unable to connect to connect to mysql server". I have tried logging into the master mysql server via the command prompt and can log in no problem. Is it possible to just update ispconfig the master server without updating the slave servers?. Many thanks for your help!.
     
  4. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Hi,

    no that's not possible. The slave won't get any changes from the master then.
    If you cannot connect please make sure that
    - the firewall on your master server permits mysql access from outside
    - the /etc/mysql/my.cnf has no "bind localhost" or "bind 127.0.0.1" etc.
    - the mysql database is configured to allow mysql root access from outside or at least from the slave server
     
  5. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    And I just had a second look at your script.
    May it be that you forgot to include the connecting lines? like $client = new SoapClient... etc.?
    That's missing in the script so it can never work this way.
     
  6. saco721

    saco721 Member HowtoForge Supporter

    Hi Croydon, still trying to work out why I cant connect to the mysql server, I have tried looking in the my.cnf file and it has no entry for "bind localhost" or "bind 127.0.0.1".

    I have tried connecting remotely using :

    and get back :
    I have not modified any settings since setting up my servers, so the firewall / database will have the original configuration, does this mean the firewall permits mysql access from outside by default? or do I have to make the changes manually after installation?

    I was also wondering how I check to make sure the the mysql database is configured to allow mysql root access from outside or at least from the slave server.

    Thank you very much for your help.
     
  7. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    This error means that root access from your second server to the master is not allowed.

    You could execute the following mysql statements on your master before the slave update:
    Code:
    GRANT ALL PRIVILEGES ON dbispconfig.* TO 'root'@'80.229.220.11' IDENTIFIED BY 'enterapassword here';
    You can then use this password with user root during the slave update, when it asks for master database cedentials.

    And this statements on the master after the update is finished:
    Code:
    DROP USER 'root'@'80.229.220.11' ; FLUSH PRIVILEGES ;
     
  8. saco721

    saco721 Member HowtoForge Supporter

    Hi Croydon,

    Thank you for your help, but I still can't connect to the master server from within the ispconfig updater. I can now connect remotely. What else can I try?
     
  9. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    The update is run on the server with the above ip?
    Try to run the two commands with the hostname of the slave server instead of the ip.
    like 'root'@'my.serverslave.com'
     
  10. saco721

    saco721 Member HowtoForge Supporter

    Hi Croydon,

    I have looked at the users created in phpmyadmin and I see :

    root 81.174.237.218 database-specific ALL PRIVILEGES No

    It seems like all priviledges are not being granted for root. Could this be the reason its not working?
     
  11. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    No, that doesn't seem to have anything to do with it.

    Please check if you inserted the ip of the slave server in the commands I mentioned and repeat the same command with the server's hostname instead of the ip.
    Then try updating again.

    And be sure you run the mysql commands on the master, not on the slave ;)
     
  12. saco721

    saco721 Member HowtoForge Supporter

    Hi Croydon,

    I'm almost there, web, database and name servers have been updated successfully, but my mail server isn't updating. What else can I try?. I really appreciate the help you have given me today - many thanks
     
  13. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    "Isn't updating" means what?
    Can you connect as root from that server?
     
  14. saco721

    saco721 Member HowtoForge Supporter

    Sorry, I should have been more specific.

    I ran the following query :



    When trying to update ispconfig on my mail server, I confirm the mysql master hostname, username, password and mysql master server database name, I then get the error message "Unable to connect to mysql server". This process worked fine on all the other servers.

    If I drop the user and run the query :

    And issue the command :
    I can remotely connect.
     
  15. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Ok, have you tried if the update works on this server, if you use the ip in the GRANT command instead of the hostname - or do both GRANT commands, the one with ip and the one with hostname.

    Maybe your mail server behaves different.
    If your mailserver has different ips, try adding them all, each in it's own GRANT command, since it's not always the main ip that is used to connect.

    Remember to DROP all root users you created this way.
     

Share This Page