Hello all, I'm new user and have a question about Remote API Scripts For ISPConfig 3. I followed link https://www.howtoforge.com/how-to-create-remote-api-scripts-for-ispconfig-3 and i don't understand location that i put new script for it possible work: it may be new file php or in file exist as remote.inc.php, config.inc.php,.... In other word, i don't know how to use it. Can someone help me, please? Very thanks if guidline step by step about it. P/S: sorry about my English language.
you put the script into a webspace with php support, this can be on any server that is connected to the internet as the api works over tcp/ip.
Hi Till, thanks for quick reply. I'm newbie about ispconfig and php, so can you give me a example simple for it? As you said above, example put lines in script to a file php exist as remote.ini.php, config.inc.php,... Follow link https://www.howtoforge.com/how-to-create-remote-api-scripts-for-ispconfig-3, i don't understand section "Using everything we have learned so far we can create" and section "Here is the beginning of the script to log into Soap" that lines code will be added where? Thank you.
I'am sorry, I cant teach you how to program php, thats a wide field. Some PHP knowledge is required to use the api, so you should consider to learn php first or ask someone with php knowledge to write the scripts for you.
Hi Till, I'm thinking you're a little bit misleading I will be more specific so that you can understand and help me, please. When i open folder /ispconfig3_install/remoting_client/examples in the installer after unpacking, i see mutiple php file. I noticed the other php files require to file soap_config.php, but after install ispconfig 3 i don't see this file, why? I ask this question because follow link https://www.howtoforge.com/how-to-create-remote-api-scripts-for-ispconfig-3, as far as i understand i can write script into a file similar file soap_config.php?
This folder contains example scripts for you to open them on the desktop with an editor to see how a api implementation can look like. Thats nothing to be installed on a ispconfig server directly, they exist as developer reference. Yes. This tutorial requires that you have experience in php programming.
Hi Till, can you tell me which folders can I put the script that I wrote like the scripts in directory /ispconfig3_install/remoting_client/examples in the installer?
This can be any folder on a desktop computer or server that is able to reach the server that has ispconfig installed over a tcp/ip network. The only prerequisite is that this computer has php installed (commandline php, when you write a cli script) or php in a website (apache, iis, nginx or other webserver) that has php enabled.
firstly let me apologize if my question somewhat naive I'm asking this book scripts on the server was installed ISPConfig: I find $soap_location = 'http://localhost:8080/remote/index.php' and $soap_uri = 'http://localhost:8080/remote/' are links that we can access after write scripts, content of index.php require to config.inc.php and app.inc.php,.... Then with link log into Soap, we must have some way to indicate the use of these scripts?Like that into folder /ispconfig3_install/remoting_client/examples in the installer, I noticed the other php files require to file soap_config.php
When you run a remote api script on the same server where the ispconfig instance is installed that you like to connect to, then you use localhost. When you run the script on another server or your desktop, then you use the ip address or server hostname of the ispconfig server instead of localhost inside the connection string.
Things you say I completely understand, I realized that I was misunderstood about SOAP Ok Till, but after install ispconfig 3 follow link https://www.howtoforge.com/perfect-...2-php-mysql-pureftpd-bind-dovecot-ispconfig-3, i acccess url https://ip-address:8080/remote/ and it's blank page, I also have to configure anything else?
A blank page is good. the page has to be blank when you open it in a browser as your browser is a http client and not a soap connector.
Thank you very much Till, I will try to practice with a simple example to understand and will discuss further with your back
Hi Till, I wil use server that installed php + apache2 + ispconfig 3 for my example. Default page is index.html and i can access via url http://ip-address nomarl, and i change it to index.php, index.php is script that I follow the instructions via link https://www.howtoforge.com/how-to-create-remote-api-scripts-for-ispconfig-3. After restart apache 2 i access url http://ip-address and it's blank page, am i calling SOAP API wrong?
The above examples and soap api is for ispconfig 3, not ispconfig 2. ISPConfig 2 and ispconfig 3 are completely different software packages, so nothing from ispconfig 3 applies to the older ispconfig 2 version. ISPConfig 2 has been discontinued years ago.
I'm so sory because the post above is wrong information (i have changed it), exactly I'm using ispconfig 3 not 2 Can you give me advice, Till?
The soap api is not on http://ip-address, the api connector is in a subfolder of the ispconfig installation. Please see the soap_config.php file of the remote api example scripts. $soap_location = 'http://192.168.0.105:8080/remote/index.php'; $soap_uri = 'http://192.168.0.105:8080/remote/'; or $soap_location = 'https://192.168.0.105:8080/remote/index.php'; $soap_uri = 'https://192.168.0.105:8080/remote/'; when your ispconfig interface uses https.
It seems we do not understand each other This is content of script index.php that I write: Code: <?php /* $domain_id = $client->sites_ftp_user_add($session_id, $client_id, $params_ftp); */ $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',); $username = 'xxx'; $password = 'yyy'; $soap_location = 'https://ip-address:8080/remote/index.php'; $soap_uri = 'https://ip-address:8080/remote/'; $client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri)); try { //* Login to the remote server if($session_id = $client->login($username,$password)) { echo 'Logged into remote server sucessfully. The SessionID is '.$session_id.' '; //* Logout if($client->logout($session_id)) { echo "FTP Created"; } } catch (SoapFault $e) { die('SOAP Error: '.$e->getMessage()); echo "Please contact the server administator"; } ?> User and password (XXX-YYY) i created in control panel, and ip-address is ip address of my server. It is wrong?
This looks fine on the first glance. and which message do you get from this script in the browser and in the apache error,.log of the website where you uploaded it?
Browser is blank page. In error.log of apache, it say "PHP Parse error: syntax error, unexpected 'catch' (T_CATCH) in /var/www/html/index.php on line 54", that mean is at section "} catch (SoapFault $e) {"?