Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 18th April 2011, 05:43
joecoder joecoder is offline
Junior Member
 
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Question 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?
Reply With Quote
Sponsored Links
  #2  
Old 18th April 2011, 10:01
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,504
Thanks: 813
Thanked 5,265 Times in 4,129 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 18th April 2011, 17:28
joecoder joecoder is offline
Junior Member
 
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4  
Old 18th April 2011, 17:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,504
Thanks: 813
Thanked 5,265 Times in 4,129 Posts
Default

Thats the correct function.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 22nd April 2011, 04:41
joecoder joecoder is offline
Junior Member
 
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #6  
Old 22nd April 2011, 04:43
joecoder joecoder is offline
Junior Member
 
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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"
Reply With Quote
  #7  
Old 3rd May 2011, 00:57
otacon otacon is offline
Senior Member
 
Join Date: Sep 2010
Posts: 109
Thanks: 5
Thanked 5 Times in 5 Posts
Default

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); 
__________________
Debian 7.4 Server:
ISPConfig Version: 3.0.5.3

Please visit my Mini-howto, "How To Create Remote API Scripts For ISPConfig 3"
Reply With Quote
The Following User Says Thank You to otacon For This Useful Post:
falko (4th May 2011)
  #8  
Old 3rd May 2011, 01:14
Ryein Ryein is offline
Junior Member
 
Join Date: Feb 2011
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Awesome! Thanks ... I am going to try this out!!
Reply With Quote
  #9  
Old 3rd December 2011, 10:28
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
 
Default

Quote:
Originally Posted by otacon View Post
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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
autosignup remoting framework howto detailed kextra1 Tips/Tricks/Mods 21 1st March 2012 06:59
API Documentation is broken jmontoya General 3 28th July 2010 11:16
API is not working, No documentation HostBill General 3 4th March 2010 17:15
IspConfig Remoting Framework Installation geoffmerritt Installation/Configuration 1 27th October 2008 08:26
About Remoting Framework API mark0168 General 1 28th March 2008 14:08


All times are GMT +2. The time now is 09:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.