[ Please press ENTER every 70 chars or so. Thansk. ]

On Fri, Oct 19, 2001 at 12:08:57PM -0400, Mark E. Crane <[EMAIL PROTECTED]> wrote:
| I've installed redhat 7.1 and am using the included Apache build.  I'm trying 
| to figure out how to set it up so that each user account has there own little cg
| i-bin directory where they can install scripts and not hose the entire system.  
| 
| I put a cgi-bin directory inside /skel so it's created with the creation of each 
|account.  Permissions on the cgi-bin (for now) are set to 2755.
| 
| It is when I am messing around with httpd.conf that I get confused (understatement).
| 
| There appears to be three ways to enable cgi-bin directories, scriptalias, 
|addhandler, and  <directory>
| 
| Right now, when I attempt to run a script I get "premature end of header" errors in 
|the logs.

This is indicative of your httpd.conf config being ok, because it means
the CGIs are being run. "premature end of header" means the CGI script
has not emitted the required MIME headers to indicate what kind of data
it is generating. CGIs may emit anything, not just HTML. So the naive:

        #!/bin/sh
        echo '<HTML><BODY><H1>A Heading</H2></BODY></HTML>'

is not enough to produce the simple HTML result:

        <HTML><BODY><H1>A Heading</H2></BODY></HTML>

Instead you need something like this:

        #!/bin/sh
        echo 'Content-Type: text/html'
        echo
        echo '<HTML><BODY><H1>A Heading</H2></BODY></HTML>'

To create:

        Content-Type: text/html

        <HTML><BODY><H1>A Heading</H2></BODY></HTML>

All CGIs must produce that header and the blank line delimiting the
header from the data as a minimum.

The error you are seeing means either that your CGI is not doing
or, or that it is failing in some way, dying before the headers get
emitted. Have a look at the error_log file for your server and see if
there's anything useful there - CGI error messages end up there unless
you take special steps.

Cheers,
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

To understand recursion, you must first understand recursion.



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to