Subject: Re: help!!!!
To: webmaster@datazap.net <webmaster@datazap.net>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 05/06/2002 16:22:38
On Mon, 6 May 2002, webmaster@datazap.net wrote:

> It seems to only log some of the time or only some of the information, but
> it never logs any error 500's.

Well, I looked at the code.

I see it logs about the 500 internal error many, many times. It doesn't
say "500" with these logged errors. Your error log will say stuff like:

fork

fdopen

pipe

execve

readlink

too many symlinks in

check_hash_size() failure

open

not enough memory

mmap

read

add_hash() failure


And most of these have corresponding strerror error message.

Look at your logs for these. Not for "500".

If you don't find answer in logs...

Also, it sends the 500 Internal Error without corresponding syslog on
these situations:

- Stat the file.

- malloc returns 0 in mmc_map

Here are untested patches:

--- mmc.c.orig  Mon May  6 16:04:35 2002
+++ mmc.c       Mon May  6 16:05:24 2002
@@ -138,6 +138,7 @@
        m = (Map*) malloc( sizeof(Map) );
        if ( m == (Map*) 0 )
            {
+           syslog( LOG_ERR, "not enough memory" );
            (void) close( fd );
            return (void*) 0;
            }

--- libhttpd.c.orig     Mon May  6 16:05:49 2002
+++ libhttpd.c  Mon May  6 16:13:34 2002
@@ -3161,6 +3161,7 @@
     /* Stat the file. */
     if ( stat( hc->expnfilename, &hc->sb ) < 0 )
        {
+       syslog( LOG_ERR, "Couldn\'t stat %s - %m", hc->expnfilename );
        httpd_send_err( hc, 500, err500title, "", err500form, hc->encodedurl );
        return -1;
        }


Good luck,

   Jeremy C. Reed
   http://www.reedmedia.net/