Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th February 2013, 14:42
NewRehtse NewRehtse is offline
Junior Member
 
Join Date: Feb 2013
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
Default Problem creating a web domain using the remote api

Hello everybody!

I am doing a wizard to create sites and ftp users and I am having issues with the creation of the web domain.

I create using the ispconfig3 functions a client (client_add), a web_domain (sites_web_domain_add) and a ftp user (sites_ftp_user_add) and all of them are listed on the ISPConfig Panel administration.

The problem is that the web domain doesn't work until I go to the panel edit and save it again (without change anything), I think that is something I am not configuring ok on the params or maybe there is another function resync or refresh that I should call.

The params are:

PHP Code:
$default_website_params = array(
        
'ip_address' => '',
        
'domain' => $domain,
        
'type' => 'vhost',
        
'parent_domain_id' => 0,
        
'vhost_type' => 'name',
        
'hd_quota' => 100,
        
'traffic_quota' => 4000,
        
'cgi' => 'n',
        
'ssi' => 'n',
        
'suexec' => 'n',
        
'errordocs' => 1,
        
'is_subdomainwww' => 1,
        
'subdomain' => 'none',
        
'php' => 'mod',
        
'ruby' => 'n',
        
'redirect_type' => '',
        
'redirect_path' => '',
        
'ssl' => 'n',
        
'ssl_state' => '',
        
'ssl_locality' => '',
        
'ssl_organisation' => '',
        
'ssl_organisation_unit' => '',
        
'ssl_country' => 'ES',
         
'ssl_domain' => $domain,
        
'ssl_request' => '',
        
'ssl_cert' => '',
        
'ssl_bundle' => '',
        
'ssl_action' => '',
        
'stats_password' => '',
        
'stats_type' => 'webalizer',
        
'allow_override' => 'All',
        
'apache_directives' => '<Directory /var/www/comunes>'.chr(13).' Order allow,deny'.chr(13).' Allow from all'.chr(13).' </Directory> ',
//         'php_open_basedir' => '/var/www/comunes',
        
'custom_php_ini' => '',
        
'backup_interval' => 'none',
        
'backup_copies' => 1,
        
'active' => 'y',
        
'traffic_quota_lock' => 'n'
); 
In this way, the web domain is on the ispconfig panel and if i open it and save it works... but it is not what i want.

Other thing I have tried is to set the ip_address to * because it is an * in other domain I have but then I get the error: Error 101 (net::ERR_CONNECTION_RESET).

The code I use to create the web domain is in a function of a class i did:

PHP Code:
public function addWebSite($clientid$params) {
            
$params['server_id'] = $this->server_id;
            
utf8_encode_array($params,'utf8_decode_array');
            try {
                return 
$this->soapClient->sites_web_domain_add($this->session_id$clientid$params$readonly false);
            }  catch (
SoapFault $e) {
                throw new 
IspcfgException($e->getMessage(), 500);
            } catch (
Exception $e) {
                throw new 
IspcfgException($e->getMessage(), 500);
            }
        } 
Thank you very much in advance!
Reply With Quote
Sponsored Links
  #2  
Old 14th February 2013, 15:11
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,488
Thanks: 813
Thanked 5,259 Times in 4,123 Posts
Default

Quote:
I think that is something I am not configuring ok on the params
Thats the most likely reason. There is no other function that has to be called.

To find out which parameters you might have missed, create a website in the ispconfig and then create a website with the api and compare the settings of both records in the database.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
NewRehtse (15th February 2013)
  #3  
Old 14th February 2013, 15:44
NewRehtse NewRehtse is offline
Junior Member
 
Join Date: Feb 2013
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
Default

The main difference is the * in ip_address but it gives me error 101, and this error appears only with i put the * ¿? I dont understand why, it is a 101 error!
Reply With Quote
  #4  
Old 14th February 2013, 19:42
NewRehtse NewRehtse is offline
Junior Member
 
Join Date: Feb 2013
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
Default

It is solved, at the end it was other unrelated problem but i still don't know why it worked when the ip_address parameter was empty and with the '*' doesn't....

The problem was that the same script creates the ispconfig user, web domain and ftp user and after that it uploads all the data to the new web site but because it was so quickly the ftp upload fails because there wasn't enough time... so I put a sleep(15) between the ispconfig creation and the ftp upload stuff... and the sleep was causing the 101 error.
Reply With Quote
  #5  
Old 15th February 2013, 09:17
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,488
Thanks: 813
Thanked 5,259 Times in 4,123 Posts
 
Default

ISPConfig is working asyncroniously, the ispconfig server part is checking every 60 seconnds if there were changes made trough the interface (or api). So if you want to upload data to a ftp user created with the api, wait at least 60 seconds.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
NewRehtse (15th February 2013)
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
problem with remote fonction versatile Developers' Forum 1 15th March 2012 08:52
Problem to create a new web domain gillesdevals Installation/Configuration 1 6th February 2012 09:35
[Info] Remote Desktop Solutions for Linux mar.and65 Desktop Operation 0 27th April 2011 07:05
Runaway script creating folders in web root skinner_au General 3 22nd February 2011 17:34
Need some Hints to "The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3]" wahid HOWTO-Related Questions 10 25th August 2010 15:18


All times are GMT +2. The time now is 05:58.


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