怎样编程CGI脚本,从远程执行执行通过SSH和显示数据远程脚本? [英] How do I program a CGI script to execute a remote script over ssh and display data from the remote execution?

查看:191
本文介绍了怎样编程CGI脚本,从远程执行执行通过SSH和显示数据远程脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我有放置在ServerA和CGI脚本的HTML页面和CGI脚本可以调用ServerB上的Perl脚本,将从DB和ServerA上的HTML页面获取数据这种特殊情况下的显示数据。

I have this particular case where I have to place the HTML pages and CGI scripts on ServerA and the CGI scripts will have to invoke Perl scripts on ServerB which will fetch data from a DB and the HTML pages on ServerA are to display the data.

我成功的远程触发Perl脚本,但我无法决定最好的办法是让从ServerB上的数据传回服务器A什么,并把它与该架构显示?

I am successful at remotely triggering the perl script but am unable to decide what the best way is to get the data from ServerB back to ServerA and have it displayed with this architecture?

我考虑以下几点:
服务器B出口数据,这是调回使用scp到服务器A一个平面文件。 SCP可在serverB上的Perl文件进行配置。

I considered the following: ServerB exports data to a flatfile which is transferred back using scp to ServerA. The scp can be configured in the perl file on serverB.

问题1:如何获得服务器A上的CGI要等到服务器B返回的数据。如何处理在不返回数据错误或案件时,输入参数传递给SERVERB AE不正确的?

Question1: How do I get the CGI on ServerA to wait until ServerB returns data. How do I handle error cases where data is not returned or when input parameters passed to ServerB ae incorrect?

问题2:有没有更好的方法来解决这个需求的计划?

Question2: Is there a better way to program around this requirement?

推荐答案

就个人而言,我会倾向于使用的 DBD ::从服务器A代理与ServerB上的代理,并获得数据的直接 - 让你操纵它在你的CGI脚本。当然,这是假设你需要的数据回来的速度不够快不计时什么的。

Personally, I'd be tempted to use DBD::Proxy from ServerA with the proxy on ServerB, and get the data "directly" - allowing you to manipulate it in your CGI script. Of course, this assumes the data you need comes back quickly enough not to time anything out.

这篇关于怎样编程CGI脚本,从远程执行执行通过SSH和显示数据远程脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆