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 24th October 2011, 19:11
dgmufasa dgmufasa is offline
Member
 
Join Date: Oct 2011
Posts: 86
Thanks: 5
Thanked 1 Time in 1 Post
Default ISPConfig 3.0.3.3 Bug or feature :-)

Hello all,

I am using the ISPConfig API (with PHP). I was able to run it pretty well until I had hit this issue.

I am getting the following error when trying to add web domain to the system: session_does_not_existThe Session is expired or does not exist.

Below are the code and inputs.

Does anyone out there know why this is taking place or what one can do to troubleshoot it further?

TIA


The output

Logged successfull. Session ID:b375a638d8c5bc20baee88750c6711a1

Session ID set is: b375a638d8c5bc20baee88750c6711a1

The items passed in
Array ( [server_id] => 1 [ip_address] => * [domain] => foofoo.com [type] => vhost [parent_domain_id] => 0 [vhost_type] => name [document_root] => /var/www/clients/client41/web123 [system_user] => web123 [system_group] => client41 [hd_quota] => 100000 [traffic_quota] => -1 [cgi] => y [ssi] => y [suexec] => y [errordocs] => 1 [is_subdomainwww] => 1 [subdomain] => www [php] => fast-cgi [ruby] => n [redirect_type] => [redirect_path] => [ssl] => n [ssl_state] => [ssl_locality] => [ssl_organisation] => [ssl_organisation_unit] => [ssl_country] => [ssl_domain] => [ssl_request] => [ssl_cert] => [ssl_bundle] => [ssl_action] => [stats_password] => [stats_type] => webalizer [allow_override] => All [apache_directives] => [php_open_basedir] => /var/www/clients/client41/web123/web:/var/www/clients/client41/web123/tmp:/var/www/stashandcarry.com/web:/srv/www/stashandcarry.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin [custom_php_ini] => [backup_interval] => none [backup_copies] => 1 [active] => y [traffic_quota_lock] => n )


PHP Code:
    public function __siteaddwebdomain$inrecserverid$inrecclientid$indomainid$inwebsiteid
    
$inlinuxuser$webrootdir$injoomlaid$indomname ){
        try {
            
$affected_rows = -999999;
            
            if  ( !( 
$inrecclientid and $inrecclientid 9999 ) ) {
                die(
"=> ERROR: Invalid client id: $inrecclientid was passed into function. Check the system");
            }
            
            
$wlinuxgroup     "client" $inrecclientid;            
            
$wlinuxuser      "web" $injoomlaid;
            
$wsetroot         $webrootdir "/" $wlinuxgroup "/" $wlinuxuser;
            
            
            echo 
"=> Linux Group: $wlinuxgroup  Linux User: $wlinuxuser will be created <br />";
            
            if(
$session_id $this -> ispclient->login($this -> ispcusername,
            
$this -> ispcpassword)) {
                echo 
'<br />Logged successfull. Session ID:'.$session_id.'<br />';
            }

            
$params = array(
            
'server_id'         => $inrecserverid,
            
'ip_address'         => '*',
            
'domain'             => $indomname,
            
'type'                 => 'vhost',
        
    
'parent_domain_id'     => 0,
            
'vhost_type'         => 'name',
            
'document_root'     => $wsetroot,
            
'system_user'         => $wlinuxuser,
        
    
'system_group'         => $wlinuxgroup,
            
'hd_quota'             => 100000,
            
'traffic_quota'     => -1,
            
'cgi'                 => 'y',
            
'ssi'                 => 'y',
            
'suexec'             => 'y',
            
'errordocs'         => 1,
            
'is_subdomainwww'     => 1,
            
'subdomain'         => 'www',
            
'php'                 => 'fast-cgi',
            
'ruby'                 => 'n',
            
'redirect_type'     => '',
            
'redirect_path'     => '',
            
'ssl'                 => 'n',
            
'ssl_state'         => '',
            
'ssl_locality'         => '',
            
'ssl_organisation'         => '',
            
'ssl_organisation_unit' => '',
            
'ssl_country'         => '',
            
'ssl_domain'         => '',
            
'ssl_request'         => '',
            
'ssl_cert'             => '',
            
'ssl_bundle'         => '',
            
'ssl_action'         => '',
            
'stats_password'     => '',
            
'stats_type'         => 'webalizer',
            
'allow_override'     => 'All',
            
'apache_directives' => '',
            
'php_open_basedir'     => "/var/www/clients/$wlinuxgroup/$wlinuxuser/web:/var/www/clients/$wlinuxgroup/$wlinuxuser/tmp:/var/www/stashandcarry.com/web:/srv/www/stashandcarry.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin",
            
'custom_php_ini'     => '',
            
'backup_interval'     => 'none',
            
'backup_copies'     => 1,
            
'active'             => 'y',
            
'traffic_quota_lock' => 'n'
            
);
                
            
$readonly false;
            
            echo 
"<br /> Session ID set is: $session_id <br />";
            echo 
"<br /> The items passed in <br /> ";
            
print_r($params);
            
            
$affected_rows $this -> ispclient -> sites_web_domain_add($inrecserverid$inrecclientid
            
$params$readonly);

            echo 
"Web Domain ID: ".$affected_rows."<br>";

            if(
$this -> ispclient ->logout($session_id)) {
                echo 
'Logged out.<br />';
            }
            
        } catch (
SoapFault $e) {
            echo 
$this -> ispclient ->__getLastResponse();
            die(
'SOAP Error ADD WEB DOMAIN: '.$e->getMessage());
        }
        
        return 
$affected_rows;
    } 
Reply With Quote
Sponsored Links
  #2  
Old 24th October 2011, 19:34
dgmufasa dgmufasa is offline
Member
 
Join Date: Oct 2011
Posts: 86
Thanks: 5
Thanked 1 Time in 1 Post
Default

Hi again,

I found a solution in another thread and followed it. I still came up with an error.

What could be the problem?

TIA


=> Linux Group: client42 Linux User: web123 will be created <br /><br />Logged successfull. Session ID:b76646bfa8c47375953830dba53b67b1<br /><br /> Session ID set is: b76646bfa8c47375953830dba53b67b1 <br /><br /> The items passed in <br /> Array
(
[server_id] => 1
[ip_address] => *
[type] => vhost
[vhost_type] => name
[document_root] => /var/www/clients/client42/web123
[system_user] => web123
[system_group] => client42
[domain] => foofoo.com
[traffic_quota] => -1
[hd_quota] => -1
[cgi] => y
[ssi] => y
[suexec] => y
[errordocs] => y
[subdomain] => none
[php] => fast-cgi
[active] => y
)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>session_does_not_exist</faultcode><faultstring>The Session is expired or does not exist.</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP Error ADD WEB DOMAIN: The Session is expired or does not exist.
Reply With Quote
  #3  
Old 24th October 2011, 19:54
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,976
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

Every function in the API requires the session_id as first parameter as http is a stateless protocol. In your script you did not pass the session_id to the sites_web_domain_add function as first parameter.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 24th October 2011, 21:54
dgmufasa dgmufasa is offline
Member
 
Join Date: Oct 2011
Posts: 86
Thanks: 5
Thanked 1 Time in 1 Post
 
Default

Thanks so much for the response.

I guess I am tired. I never saw the problem at all

I have been making changes to the inputs. Here is the last one:

The items passed in
Array ( [server_id] => 1 [ip_address] => * [type] => vhost [vhost_type] => name [document_root] => /var/www/clients [system_user] => 49 [system_group] => 49 [domain] => foofoo.com [traffic_quota] => -1 [hd_quota] => -1 [cgi] => y [ssi] => y [suexec] => y [errordocs] => y [subdomain] => none [php] => fast-cgi [active] => y )

Are these OK to use? I saw this other thread:
http://www.howtoforge.com/forums/showthread.php?t=52837

But, at the same time, I am going off of what I had seen in the fields of the
"web_domain" table.

Any hints on this?

Thanks again for pointing out such an interesting mistake
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
Version 1.3 of the ISPConfig 3 Manual is finally available! falko General 44 2nd December 2011 12:04
PHP warnings after upgrade to ISP config 3.03 stevegjacobs Installation/Configuration 5 30th October 2010 14:31
ISPconfig 3: can't send or receive messages zogthegreat Installation/Configuration 6 22nd May 2010 14:45
Hosting multiple websites and webmail dmwcool Installation/Configuration 8 30th March 2010 03:15
ISPConfig 3.0.0.9 RC2 released till General 51 17th April 2009 17:12


All times are GMT +2. The time now is 21:37.


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