开发者

Net::SFTP hangs in apache environment

I am finding that apache environment lacks something that bash has to make an ssh request. The question is, is there any way to bring that something in, or do I have to run SSH/SFTP requests from shell?

I am running an sftp login with username and password using Net:::SFTP. Debug logs are identical from the shell and apache. The only differences are that

a) the one from Apache runs an order of magnitude slower (I wonder why?) b) most importantly, it hangs at

sftp: Sending SSH2_FXP_INIT

I ha开发者_如何转开发ve tried to do all I could to make the environment similar, but without knowing what to look for, didn't hit the solution yet.

I am running apache 2.2.3, mod_perl 2.0.4, perl 5.8.8, Net::SFTP 0.10, OpenSSL 0.9.8 . No interesting parameters sent to Net::SFTP constructor, just debug.

Thanks for your help!


If you have some sort of network listening program, I would try and listen to that connection and dump the data that you're getting. The solution would be different if you're timing out at a certain part of the handshake, versus if there's some sort of error occuring that Net::SFTP is eating and not reporting on. I'd recommend using tcpdump to try and find that out, since I'm assuming you're on a Linux/BSD system.


I eventually found out that this is a result of STDIN, STDOUT being bound to filehandle objects instead of actual filehandles in modperl. This is the cause of the underlying problem.

Pointing both to /dev/null fixes it. I still need to dig out a better solution than /dev/null, but this knowledge would have been sufficient to understand the problem in question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜