[Techtalk] CGI page from Accounting Server
Dominik Schramm
dominik.schramm at slivery.cotse.net
Sun Jan 22 20:18:01 EST 2006
Hi Meryll,
"Meryll Larkin" <alwanza at oz.net> wrote:
> [...]
> The part I need help with is this:
> The Accounting database and the Intranet live on two different
> servers (on the same LAN, different static IPs). The test-program I
> wrote is on the Accounting Server but ideally, we would want the CGI
> page to reside on the Intranet server.
> [...]
The simplest way to do this (the one I would choose) is this:
Intranet Server = IS
Accounting Server = AS
request request
Client --------> IS:cgi1 --------> AS:cgi2
<------- <-------
The client requests the info from cgi1 on IS (can be a dummy CGI,
which actually does nothing "on its own"), which in turn makes a
request to cgi2 on AS -- cgi2 on AS does all the database work and
replies to cgi1's request with the appropriate data. cgi1 one then
returns the data it has just received from cgi2 to the original
client.
For that you need a webserver on AS as well. You can make the AS
webserver accept connections only from IS (IP based check or with
authentication) if noone should be using AS's webserver directly.
Some more details in pseudo-code:
IS : cgi1
loop
if request_coming_in
then
request(from AS, cgi2)
output := reply_from_AS
reply_to_client(output)
endif
endloop
AS : cgi2
loop
if request_coming_in
then
query database
rearrange database output
filter, sort, etc.
output := formatted_db_output
reply_to_client(output)
endif
endloop
----
Other possibilities include (but are not limited to) using
distributed programming techniques, like CORBA or XMLRPC.
In any case, there *is* TCP/IP communication involved, because
communication has to pass your network. That means that something has
to sit on AS and listen for incoming connections (be it HTTP request
as in my simple approach or CORBA etc.).
I can't help you with distributed programming -- maybe others on the
list could tell more about it?! So I also can't say if setting up a
webserver on AS is easier than CORBA etc... but that might well be the
case.
hope this helps,
dominik
More information about the Techtalk
mailing list