
18th April 2011, 05:43
|
|
Junior Member
|
|
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Remoting API Documentation
Is there documentation for the remoting API? I have found the examples folder with about 40-so examples and can successfully login and create a client.
Next, I would like to create a site. I browsed the source and found interface/lib/classes/remoting.inc.php and found sites_web_domain_add. I don't know if this is the function or how to call it because I don't know what to fill in for the $params array.
Where can I find documentation for the remoting API?
|

18th April 2011, 10:01
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,899
Thanks: 693
Thanked 4,190 Times in 3,208 Posts
|
|
There is no documentation for the remote API available. But you
can find examples in the remote_client/examples/ subfolder
of the ispconfig tar.gz file. A full list of all available functions
can be found in the file /usr/local/ispconfig/interface/lib/classes/remoting.inc.php
Quote:
|
Next, I would like to create a site. I browsed the source and found interface/lib/classes/remoting.inc.php and found sites_web_domain_add. I don't know if this is the function or how to call it because I don't know what to fill in for the $params array.
|
The variables in the $params array are named like the columns in the corresponding database table. You can find also some examples and discussions here in the dev forum about that.
|

18th April 2011, 17:28
|
|
Junior Member
|
|
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Is sites_web_domain_add the correct function for adding a new site? It looks like it's just for adding a domain to an existing site, but it's the closest I could find in remoting.inc.php
|

18th April 2011, 17:33
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,899
Thanks: 693
Thanked 4,190 Times in 3,208 Posts
|
|
Thats the correct function.
|

22nd April 2011, 04:41
|
|
Junior Member
|
|
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
How do I know what values to fill in for system_user, system_group, and php_open_basedir?
I see these values filled in for other sites I've created manually in the admin, but they seem to be generated based on the users and directories that ISPConfig creates for the site?
|

22nd April 2011, 04:43
|
|
Junior Member
|
|
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If I fill in those values with some from another row, I get the error,
"Fatal error: Uncaught SoapFault exception: [data_processing_error] documentroot_error_empty"
|

3rd May 2011, 00:57
|
|
Member
|
|
Join Date: Sep 2010
Posts: 93
Thanks: 4
Thanked 5 Times in 5 Posts
|
|
Example of creating a site through API
PHP Code:
$params_website = array('server_id' => 1,
'ip_address' => '*',
'domain' => $myusername.'.remcycle.net',
'type' => 'vhost',
'parent_domain_id' => '',
'vhost_type' => 'name',
'hd_quota' => 999999,
'traffic_quota' => '1000',
'cgi' =>'y',
'ssi' =>'y',
'suexec' =>'y',
'errordocs' =>'1',
'subdomain' =>'www',
'ssl' =>'n',
'php' =>"mod",
'ruby' =>'y',
'active' =>'y',
'redirect_type' =>'no',
'redirect_path' =>'',
'ssl_state' =>'',
'ssl_organisation' =>'',
'ssl_organisation_unit' =>'',
'ssl_country' =>'',
'ssl_domain' => $myusername.'.remcycle.net',
'ssl_request' =>'',
'ssl_cert' =>'',
'ssl_bundle' =>'',
'ssl_action' =>'',
//'stats_password' =>$mypassword,
'stats_password' =>'',
'stats_type' =>'webalizer',
'backup_interval' =>'daily',
'backup_copies' =>'7',
'document_root' =>'/var/www/clients/client'.$client_id.'/web'.$domain_id,
'system_user' =>'web'.$domain_id,
'system_group' =>'client'.$client_id,
'allow_override' =>'All',
'php_open_basedir' =>'/var/www/clients/client'.$client_id.'/web'.$domain_id.'/web:/var/www/clients/client'.$client_id.'/web'.$domain_id.'/tmp:/var/www/'. $myusername.'.remcycle.net/web:/srv/www/'.$myusername.'.remcycle.net/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin',
'custom_php_ini' =>'',
'apache_directives' => '<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>',
'client_group_id' =>$client_id +1
);
$website_id = $client->sites_web_domain_add($session_id, $client_id, $params_website);
|
|
The Following User Says Thank You to otacon For This Useful Post:
|
|

3rd May 2011, 01:14
|
|
Junior Member
|
|
Join Date: Feb 2011
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
Awesome! Thanks ... I am going to try this out!!
|

3rd December 2011, 10:28
|
|
Senior Member
|
|
Join Date: Jul 2007
Location: Italy
Posts: 654
Thanks: 77
Thanked 12 Times in 7 Posts
|
|
Quote:
Originally Posted by otacon
Example of creating a site through API
PHP Code:
$params_website = array('server_id' => 1,
'ip_address' => '*',
'domain' => $myusername.'.remcycle.net',
'type' => 'vhost',
'parent_domain_id' => '',
'vhost_type' => 'name',
'hd_quota' => 999999,
'traffic_quota' => '1000',
'cgi' =>'y',
'ssi' =>'y',
'suexec' =>'y',
'errordocs' =>'1',
'subdomain' =>'www',
'ssl' =>'n',
'php' =>"mod",
'ruby' =>'y',
'active' =>'y',
'redirect_type' =>'no',
'redirect_path' =>'',
'ssl_state' =>'',
'ssl_organisation' =>'',
'ssl_organisation_unit' =>'',
'ssl_country' =>'',
'ssl_domain' => $myusername.'.remcycle.net',
'ssl_request' =>'',
'ssl_cert' =>'',
'ssl_bundle' =>'',
'ssl_action' =>'',
//'stats_password' =>$mypassword,
'stats_password' =>'',
'stats_type' =>'webalizer',
'backup_interval' =>'daily',
'backup_copies' =>'7',
'document_root' =>'/var/www/clients/client'.$client_id.'/web'.$domain_id,
'system_user' =>'web'.$domain_id,
'system_group' =>'client'.$client_id,
'allow_override' =>'All',
'php_open_basedir' =>'/var/www/clients/client'.$client_id.'/web'.$domain_id.'/web:/var/www/clients/client'.$client_id.'/web'.$domain_id.'/tmp:/var/www/'. $myusername.'.remcycle.net/web:/srv/www/'.$myusername.'.remcycle.net/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin',
'custom_php_ini' =>'',
'apache_directives' => '<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>',
'client_group_id' =>$client_id +1
);
$website_id = $client->sites_web_domain_add($session_id, $client_id, $params_website);
|
Hi how do you get the domain_id index value?
thanks
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 16:52.
|
Recent comments
11 hours 5 min ago
17 hours 46 min ago
21 hours 36 min ago
23 hours 15 min ago
1 day 7 hours ago
1 day 17 hours ago
1 day 17 hours ago
1 day 21 hours ago
2 days 1 hour ago
2 days 2 hours ago