CERN W3 3.0/21.7 and CGI's

CERN W3 3.0/21.7 and CGI's

Post by Chris Johns » Fri, 19 Apr 1996 04:00:00

     I would REALLY appeciate it very much if I could get in contact
with someone who is running CERN W3 3.0/2.17 HTTPD on an ALPHA with
3.2c DU or higher and who has written cgi's for it.

     I wrote a perl 4 cgi using NSCA a while back.  Worked fine once
I got past a few gotchya's on the learning curve.  NCSA has a few
security problems I'm told.  CERN's seems to have a few less so I'm
changing to CERN's HTTPD.  Now I'm having cgi problems.  I first noticed
these while trying to write my second cgi.  I started getting the client
info box "Document contains no data".  I know this isn't right.  It
worked fine with NCSA and works the first time with CERN.  Thereafter
I get the no data box for a time.  After some indeterminate time it
will work once more and then return to no data.  It also works once
if I restart the server.  I've run it with -v and -vv.  The log and
screen output seem to be insisting that everything is fine as far as I
can tell unless I've missed something (always possible).

     There seems to by either an initialization issue or a time-out
problem of some kind.

     I'm really stuck here people or I wouldn't bother the group.

     I'd REALLY like to get in contact with anyone who knows this beastie
well enough to help.  Much appreciated if someone would respond.  Thank

Chris J.

Assistant Director, Systems
Division of Academic Computing           Voice:    617.373.3300
Northeastern University, 39 RI           FAX:      617.373.8600
360 Huntington Ave.                      Life, a bad idea who's time is
Boston, MA., U.S.A.  02115               past.    Me


CERN W3 3.0/21.7 and CGI's

Post by Chris Dalt » Fri, 19 Apr 1996 04:00:00


Quote:>      I would REALLY appeciate it very much if I could get in contact
> with someone who is running CERN W3 3.0/2.17 HTTPD on an ALPHA with
> 3.2c DU or higher and who has written cgi's for it.

Below is a copy of a mail I posted to the bugs list of the maintainers of
the CERN server. I didn't have any problems with my server after I made
the changes below. (I was getting "document contains no data" like you
from cgi scripts the worked OK of a Sun box. N.B. I did this before I
joined HP and they are not responsible for the code below.


| C.I.Dalton, Hewlett Packard Labs, Filton Rd, Bristol BS12 6QZ, UK. |


N.B. I don't speak for anyone but myself, and usually not even that.



I'm currently running the CERN httpd version 3.0 on a Dec Alpha
running OSF1 3.2C. Previously I was running it on a SunOS 4.1.3
machine. After the move to OSF1 some of the cgi-scripts started giving
the error message "Document contains no data" when accessing them from
netscape, for example. I experimented and found out that it was
dependent on when the script exited. I saw the bug/patch report listed
on your server (titled: Problems with OSF/1 version 3 and scripts) and
applied the patch (which was a "sleep" call") - it made the
scripts work OK *most* of the time but one of our scripts when
executed still caused problems. I looked at the source and came up
with the following fix instead of the one listed on your server. The
changes I made are to the HTScript.c file.

Here's a "diff HTScript.c HTScript.c.orig":

< #ifndef Original
<       int status;
<       /*

<               Surround the call to fread with sighold/sigrelse. If we
<               get a signal when executing the fread system call and we
<               haven't yet read any data, the fread will return straight
<               away (man read).
<               Since we forked a child to execute the cgi script,
<               we will get notified when that child exits (via a SIGCHLD
<               signal).  If we get this child termination signal
<               before the parent process (below) has chance to read
<               any data from its output (but has started the fread call),
<               the fread call will return without bringing us any data.
<               Hence we get a "Document contains no data" message in
<               Netscape, for example.
<       */
<       sighold(SIGCHLD);
<       status = fread(input_buffer, 1, INPUT_BUFFER_SIZE, fp);
<       sigrelse(SIGCHLD);
< #else /* Original */
<       int status = fread(input_buffer, 1, INPUT_BUFFER_SIZE,fp);
< #endif        /* Original */
- ---

Quote:>       int status = fread(input_buffer, 1, INPUT_BUFFER_SIZE, fp);

After applying this fix I haven't had any problems with cgi scripts on
the OSF1 box.

Chris Dalton.
- ----------------------------------------------------------------------------
|    C.I.Dalton, University of Wales, Computing Lab, Bangor, LL57 1LD, UK  |

- ----------------------------------------------------------------------------
------- end -------


1. CGI question with CERN 3.0 (how to make sserver run 'em?)

        I just got CERN 3.0 httpd patched source that allows for
virtual domain www's.

        My two questions are:

        1) How do I get CERN to run cgi's? I.e. can users use something

        <!--#exec cgi="/cgi-bin/counter"-->

        In their html? I have the line in all.conf set up as:

        Exec            /cgi-bin/*        /usr/local/http/htdocs/cgi-bin/*

        And the paths are corrrect, as I've verified them.

        Second question... Apache. How do I get GNU DLD package to
compile/install under Linux, in order to finish the rest of Apache

        Many thanks, will summarize any responses for either question!

-Dan Foster
System Manager
E-Znet, Inc.

2. OAS on AIX 4.3.3

3. CERN 3.0 proxy and perl cgi's cannot open file

4. NCR 53C875 SCSI adaptator

5. CERN ftp server can't open PASV for CERN httpd 3.0

6. FS: New Internet Server (Unix) in California

7. LILO version 21.7 released

8. Mediavision Fusion CD16E multimedia kit

9. Cern httpd 3.0 cgi-bin

10. CERN 3.0 / CGI Problem

11. LILO 21.7 patches issued (8-Mar, & 20-Mar)

12. CERN 3.0 / CGI Problem