Calling d3 from perl where d3 is on another linux machine inside a firewall

Calling d3 from perl where d3 is on another linux machine inside a firewall

Post by Terry Penningt » Sun, 23 Feb 2003 06:21:58



I have successfully implemented an intranet for in-house use using
perl cgi scripts to talk to d3. To do this I have an Apace web server
running on the same Linux box that d3 runs on. To make this work in
this situation all one has to do is something like this:

  $cmd="(/usr/bin/d3 -s -d
'\\musername\ruseracct\rprogname\r".$fields{"itemid"}."\rexit\r') | tr
-d \"\\00\" > /tmp/$$";

   system($cmd);

This works great when it's all on the same computer. What I'd like to
do is be able to talk to my d3 database from my public webserver in
the same manner. The public webserver is on one of our eight public IP
addresses, I have a firewall computer plugged into the same router on
another address in the same address block which in turn connects to
our private network where the d3 server resides with an internal
private address. I am able to map ports through the firewall such that
a port can map directly to an internal IP address but I have no clue
how to make it work in this situation.

Anyone accomplished this or have any ideas how it might be possible?
If it is?
Thanks for your help!

 
 
 

Calling d3 from perl where d3 is on another linux machine inside a firewall

Post by Doug Dumitr » Sun, 23 Feb 2003 08:34:08




First a comment:

You do understand that your CGI applicaton has a lot of overhead.
Running D3 for each page hit is expensive in processing terms.  If you
have enough horsepower, this works fine.  If you need it to run
faster, you have a lot of commercial product options.

In terms of interfacing, I would recommend that you run a second copy
of Apache on the internal server and place your CGI script there.  You
can then reach the internal server by placing a "ProxyPass" directive
on the public server.  This way the public server reflects the HTTP
request thru the firewall.

You can get details on ProxyPass in the Apache documentation.  This
required mod_proxy, but this is a standard part of Apache and has been
for a long time.

The setup would look like:

  Public server:

     ProxyPass /app http://192.168.0.13:80/cgi-bin/

  Private server is listening to 192.168.0.13 on port 80.  You can
then get to your private CGI directory with a URL such as:

  http://www.yourdomain.com/app/d3.pl

or whatever you call your script.

Isn't HTTP plumbing wonderful.

Quote:>I have successfully implemented an intranet for in-house use using
>perl cgi scripts to talk to d3. To do this I have an Apace web server
>running on the same Linux box that d3 runs on. To make this work in
>this situation all one has to do is something like this:

>  $cmd="(/usr/bin/d3 -s -d
>'\\musername\ruseracct\rprogname\r".$fields{"itemid"}."\rexit\r') | tr
>-d \"\\00\" > /tmp/$$";

>   system($cmd);

>This works great when it's all on the same computer. What I'd like to
>do is be able to talk to my d3 database from my public webserver in
>the same manner. The public webserver is on one of our eight public IP
>addresses, I have a firewall computer plugged into the same router on
>another address in the same address block which in turn connects to
>our private network where the d3 server resides with an internal
>private address. I am able to map ports through the firewall such that
>a port can map directly to an internal IP address but I have no clue
>how to make it work in this situation.

>Anyone accomplished this or have any ideas how it might be possible?
>If it is?
>Thanks for your help!

Doug Dumitru
EasyCo LLC
949 831-4774
http://easyco.com

 
 
 

Calling d3 from perl where d3 is on another linux machine inside a firewall

Post by Ian McGowa » Sun, 23 Feb 2003 16:15:19


[snip]

Quote:> This works great when it's all on the same computer. What I'd like to
> do is be able to talk to my d3 database from my public webserver in
> the same manner. The public webserver is on one of our eight public IP
> addresses, I have a firewall computer plugged into the same router on
> another address in the same address block which in turn connects to
> our private network where the d3 server resides with an internal
> private address. I am able to map ports through the firewall such that
> a port can map directly to an internal IP address but I have no clue
> how to make it work in this situation.

doug's answer is blindingly simple and a really good way to do
what you're asking.  i wish i had thought of it when i had this
question :-).  i ended up splitting the cgi script into two pieces
and sending the data over a socket.  see

http://www.pickwiki.com/cgi-bin/wiki.pl?PerlSource

for the perl code i used,  cgiclient.pl and cgiserver.pl.  if you
don't have a web server installed internally, the split cgi script
idea works fine, though it's more complicated and less scalable
than doug's suggestion.  still, options are good.

hth,
ian

 
 
 

Calling d3 from perl where d3 is on another linux machine inside a firewall

Post by Patrick Pay » Mon, 24 Feb 2003 02:41:32


Also keep in mind that the web request will consume a user license
when a page request is made.  If you have hits at the same time this
can result in some sessions not working.

I have been playing with the IPC::Shareable module from cpan for perl
that allows you to easily work with shared memory segments.  This
would allow you to create a shared memory variable that you can manage
access to your d3 app, allowing you to throttle back the number of
hits to d3.

- Patrick



> [snip]
> > This works great when it's all on the same computer. What I'd like to
> > do is be able to talk to my d3 database from my public webserver in
> > the same manner. The public webserver is on one of our eight public IP
> > addresses, I have a firewall computer plugged into the same router on
> > another address in the same address block which in turn connects to
> > our private network where the d3 server resides with an internal
> > private address. I am able to map ports through the firewall such that
> > a port can map directly to an internal IP address but I have no clue
> > how to make it work in this situation.

> doug's answer is blindingly simple and a really good way to do
> what you're asking.  i wish i had thought of it when i had this
> question :-).  i ended up splitting the cgi script into two pieces
> and sending the data over a socket.  see

> http://www.pickwiki.com/cgi-bin/wiki.pl?PerlSource

> for the perl code i used,  cgiclient.pl and cgiserver.pl.  if you
> don't have a web server installed internally, the split cgi script
> idea works fine, though it's more complicated and less scalable
> than doug's suggestion.  still, options are good.

> hth,
> ian

 
 
 

1. D3 7.0 to D3 7.1 Incompatibility problem with c functions on D3/Linux

Hi

I am trying to port an application from D3/SCO 7.0 to D3/Linux 7.1 and am
running into problems when calling user defined C functions.

I have successfully run addbi and the Makefile and created the new D3
executable using the same C function library that is running with D3/SCO.

I can then load the filesave from the D3/SCO 7.1 server and the basic
programs calling the C functions run normally.

BUT, when I re-compile the basic programs (without making any changes) that
call the C functions, they no longer work and give a variety of errors
including core dumps.

It would seem that if the basic program is running the pcode created on
D3/SCO 7.0, all is OK, but running the pcode created on D3/Linux 7.1 it no
longer works.

Anybody got any clues what is going on.

Thanks for any advice you can give.

Regards

Adam Easterbrook

2. ADO transactions (state)

3. Direсеrtly sending E-mail From D3 (D3/NT ior D3/Linux)

4. Log files and performance

5. D3/Linux - D3-to-Linux communication to print spooler

6. COM-Gen 2000 - Bld 306! Generates all your data objects

7. Infolink - D3/Sco to D3/Linux

8. Trunc Function formatting for dates

9. D3/Linux Restore from D3/NT

10. Time to upgrade D3/Linux or D3/NT

11. D3 NT vs. D3 LINUX

12. Moving from AP/Pro to D3/ProPlus or D3/Linux

13. D3 Linux Syntax of the D3 command.