Hello List,

I'm working on RHEL4 U03 system with Apache 2.0.52.22 and mod_perl 2.0.2-100.

I'm writting cgi script using Net-SSH-Perl and I'm getting an issue when I use 
mod_perl :
-------------------------------------------------------------------------------------------
#!/usr/bin/perl -w

use strict;
use Net::SSH::Perl;

$ENV{HOME}='/var/www';

print "Content-type: text/plain\r\n\r\n";

my @sshids         = ("$ENV{HOME}/.ssh/id_dsa");
my %sshparams      = ( protocol           => 2,
                       interactive        => 0,
                       identity_files     => [EMAIL PROTECTED],
                       debug              => "9",
                       UserKnownHostsFile => ["$ENV{HOME}/.ssh/known_hosts2", 
"$ENV{HOME}/.ssh/known_hosts" ],
                       User               => "root" );

my $ssh =  Net::SSH::Perl->new("ch-dev-3",%sshparams);
$ssh->login("root");
my ($out, $err, $exit)=$ssh->cmd("ls -l");

print $out;
-----------------------------------------------------------------------------------------------------
The connection is working fine, but there is no answer from "ls -l" and the 
script finishes after a while by a "Client connection time out".
Let say, this script is working fine in command line or like a standart cgi 
(through the same apache ... of course )
I've installed Apache::DB and compiled mod_perl with MP_DEBUG and MP_TRACE on, 
but it seems there is no pb.
Below there is the conf file for perl module and perl directory
-------------------------------------------------------------------
LoadModule perl_module modules/mod_perl.so
Alias /perl /var/www/perl
DirectoryIndex index.pl
AddHandler cgi-script .pl .sh .cgi
PerlSwitches -I/var/www/perl
PerlSetEnv PERLDB_OPTS "NonStop=1 LineInfo=/tmp/db.out AutoTrace=1 frame=2"
PerlModule Apache::DB
PerlModule Net::SSH::Perl
PerlModule Math::GMP
PerlModule Math::BigInt::GMP
<Directory /var/www/perl>
    PerlFixupHandler Apache::DB
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Directory>

<Location /perl-status>
    SetHandler perl-script
    PerlResponseHandler Apache2::Status
    Order allow,deny
    Allow from all
</Location>

PerlModule Hcook
PerlTrace all
<Location /hcook>
  SetHandler perl-script
  PerlResponseHandler Hcook
</Location>
-------------------------------------------------------------------------------------

Is there anyone who gets same issue and could help me ?
many thanks for your feedback

Best regards

patrick hartemann 

Reply via email to