[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] Trouble w. MacPerl and ASIP



>I have written a set of cgis that function as a web shop. everything works
>fine on my machine, where I use a eval. copy of webstar.
>
>However, the guys i wrote it for want to use AppleShare IP to serve the
>pages. So far, no problem.
>
>Now the following strange stuff happens: when they run the shop, only some
>of the scripts actually return html, the others time out, hang, and ASIP
>returns "504 Gateway Timeout".
>
>The shop works as follows: before you enter, there's a page giving
>instructions and License/Disclaimer info. Then you press a button (form that
>calls startshop.cgi). The script creates a session ID and a cart file, and
>then returns a html document setting up three frames. Each of the three
>frames runs a cgi script to output data from a database.
>
>Now: only one (or sometimes two) of those three scripts actually get started
>alright. The other(s) hang and sometimes take the entire machine into
>nirvana.

I'm not sure I should be answering this since you seem convinced that 
ASIP is the problem, and I have no experience with ASIP and to the 
extent I know what it is I don't see how its involved.  I thought 
ASIP was simply used for mounting remote Mac volumes via TCP/IP but 
your description seems to suggest that somehow it is a replacement 
for a Web server.  However, I do see what may be one fatal flaw in 
what you are doing.

MacPerl can only run one script at a time, and will fail gracelessly 
if you ask it to do more.  There are two ways to keep this from 
happening if you use MacPerl CGIs:

1) Never use the .acgi extension.  That signals to your Web server 
that your CGI can handle more than one thing at a time, which MacPerl 
cannot.

2) Never have more than one MacPerl .cgi on a server.  If you do, 
there is no way for your Web server to know that only one of them can 
be run at a time, and since they are both run by MacPerl, that is the 
case.

It sounds to me like you have three CGIs and are violating rule #2. 
The way to solve this is to rewrite them slightly so that rather than 
being three separate CGIs, they are three Perl modules called by one 
master CGI that does nothing but route calls to the correct module. 
You then need to add information to whatever calls the CGI to tell it 
which module to run.  This can be an extra HTML variable or an 
argument included on the URL, eg.:

http://www.yourhost.com/dispatcher.cgi$perlmodulename

If I have misunderstood you or have been unclear, please post again.

-David-
David Steffen, Ph.D.
President, Biomedical Computing, Inc. <http://www.biomedcomp.com/>
Phone: (713) 610-9770 FAX: (713) 610-9769 E-mail: steffen@biomedcomp.com

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org