using cgi scripts on an apache proxy server

using cgi scripts on an apache proxy server

Post by Seckl » Thu, 24 May 2001 22:59:58



I have written a few cgi scripts that open a directory and get alist of the
newest documents inside. We mirror our web site at another plant. we are
looking into turning the second site into a proxy server.
my question is:
how can the cgi-bin at the second site(proxy) access the data and documents
on our server?
 
 
 

using cgi scripts on an apache proxy server

Post by adam » Fri, 25 May 2001 00:27:26



> I have written a few cgi scripts that open a directory and get alist of the
> newest documents inside. We mirror our web site at another plant. we are
> looking into turning the second site into a proxy server.
> my question is:
> how can the cgi-bin at the second site(proxy) access the data and documents
> on our server?

Huh?

If you turn the machine at the remote site into a full ReverseProxy then
it won't have any cgi's running on it.  The call will get proxied to
your machine w/ the cgi's and data directories.  This won't help your
load any since the remote ReverseProxy won't cache the cgi output.  If
you're going to keep the cgi's on the remote machine you'll pretty much
need to keep any resources those cgi's access on that machine (ie, the
data directories).  Appearently you already have a way to keep those
updated.  If I didn't answer your question, please provide more details
about what you're doing so I can understand.

--
-adam                 | "Be liberal in what you accept, and
Systems Administrator |  conservative in what you send"
Indiana University    |      -Jon Postel
Bloomington, Indiana  |

 
 
 

using cgi scripts on an apache proxy server

Post by Joshua Sli » Fri, 25 May 2001 03:10:47



> I have written a few cgi scripts that open a directory and get alist of the
> newest documents inside. We mirror our web site at another plant. we are
> looking into turning the second site into a proxy server.
> my question is:
> how can the cgi-bin at the second site(proxy) access the data and documents
> on our server?

The proxy server does not serve the request at all.  All it does is
pass it through to the origin server, where the actual CGI is located.
The CGI on the origin server can access the correct files, and then
pass the results back, through the proxy server, to the client.
There shouldn't really be any cgi-bin at all at the second site.

Joshua.

 
 
 

using cgi scripts on an apache proxy server

Post by Seckl » Fri, 25 May 2001 20:22:44




> > I have written a few cgi scripts that open a directory and get alist of the
> > newest documents inside. We mirror our web site at another plant. we are
> > looking into turning the second site into a proxy server.
> > my question is:
> > how can the cgi-bin at the second site(proxy) access the data and documents
> > on our server?

> The proxy server does not serve the request at all.  All it does is
> pass it through to the origin server, where the actual CGI is located.
> The CGI on the origin server can access the correct files, and then
> pass the results back, through the proxy server, to the client.
> There shouldn't really be any cgi-bin at all at the second site.

> Joshua.

   I'm new in the field i've only been doing this for six months and when i came
on board the people who were running the website left for another job so i've
been picking u the pieces since.let me see if i can explain it better.

  right now we have a data collection/reporting website that also contains
technical documents for the products that we build, these documents take up a
lot of space. This site is on our home server and it and all the  documents are
mirrored on a server at our contract manufacturers plant. on their shop floor
we have a number of client computers that access the site as needed. what we
want to do is turn their server into a proxy server so that when the client
looks for the website it is actually calling our server. we want this to be
as fast as possible, so i believe, from what i have been told, that we will
keep the CGI-bin with all the scripts on their server.
Is this possible?

   Some of the scripts are dynamic scripts that give a listing of the newest
documents within a given directory. This directory is on their server at the
moment but when we do the change over, the scripts will have to look at our
server for the documents.
How can i make my script access our server from their site to check out the
different files?

thanks for any help given

 
 
 

using cgi scripts on an apache proxy server

Post by Joshua Sliv » Sat, 26 May 2001 05:27:06


[...]

Quote:> we have a number of client computers that access the site as needed. what we
> want to do is turn their server into a proxy server so that when the client
> looks for the website it is actually calling our server. we want this to be
> as fast as possible, so i believe, from what i have been told, that we will
> keep the CGI-bin with all the scripts on their server.
> Is this possible?

Everything is OK up to there.  What you will need to do is
called "Reverse Proxying".  You can do it with mod_proxy in Apache
with the ProxyPass/ProxyPassReverse directives and/or mod_rewrite.
You will need to set up the reverse proxy for the specific directories
that you want to proxy, but exclude the cgi directory.

Quote:>    Some of the scripts are dynamic scripts that give a listing of the newest
> documents within a given directory. This directory is on their server at the
> moment but when we do the change over, the scripts will have to look at our
> server for the documents.
> How can i make my script access our server from their site to check out the
> different files?

That would be much more complicated.  I would recommend just keeping those
particular cgi scripts on your local server and accessing them via
proxy.  If they need to check file creation times, they will work much
quicker if they have access to the local filesystem.

--
Joshua Slive

http://slive.ca/

 
 
 

1. Using .cgi/.pl to enable CGI script in Apache

I am trying to run CGI scripts local to the companion HTML documents
using the Apache server and Linux. According to the manual if I add the
lines:

AddType application/x-httpd-cgi cgi pl
AddType application/x-httpd-cgi .cgi .pl
 (yeah - I wasn't sure whether or not to include the "." so I tried it
  both ways)

to the srm.conf and restart the server, that should do it.

Not true.

I get:
***********************************************************************
        Forbidden

You don't have permission to access /chamFarm/CFemail.pl on this server.
***********************************************************************

(where CFemail.pl is the script in the HTML home directory "chamFarm"
- as expected)

 the script has 777 permissions just to enable all possible
permissions.

If I take the lines out of the srm.conf file and restart the server, I
get:

***********************************************************************
Method not implemented

POST to /chamFarm/CFemail.pl not supported.
***********************************************************************
 which, I guess, is the sort of error you might expect.

So I don't see the problem. This should be very straightforward. Does
anyone have any ideas?

        Thanks for your time,
                Gary Whitten

2. rh 7.0 iso files

3. Apache server behind Apache proxy / CGI environment question

4. Problems detecting my D-link 220 ISA PnP

5. Trouble w/CGI Scripts & Virtual Server Using Apache

6. startx can't find xinit, etc

7. Proxy serving CGI scripts via Apache...

8. Torvalds.com -- New Development

9. Using an outside proxy server form behind a proxy server

10. question on apache, proxy server, & cgi-bin

11. Redirect cgi (perl) scripts using Apache 0.8.14

12. APACHE: using CGI scripts ?

13. apache: give /home/mailman/cgi-bin permissions to run cgi-scripts.