HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   Remoting API Documentation (http://www.howtoforge.com/forums/showthread.php?t=52349)

joecoder 18th April 2011 05:43

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?

till 18th April 2011 10:01

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.

joecoder 18th April 2011 17:28

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

till 18th April 2011 17:33

Thats the correct function.

joecoder 22nd April 2011 04:41

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?

joecoder 22nd April 2011 04:43

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"

otacon 3rd May 2011 00:57

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); 


Ryein 3rd May 2011 01:14

Awesome! Thanks ... I am going to try this out!!

vaio1 3rd December 2011 10:28

Quote:

Originally Posted by otacon (Post 256335)
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


All times are GMT +2. The time now is 12:03.

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