Minor stderr tweak
[mod_fastcgi.git] / CHANGES
blob418549d5a13cccb9a9e00414672844816c367ab7
1 Changes with mod_fastcgi 2.2.3
3  *) Remove request type restriction (GET and POST only) in order to support
4     Web DAV requests.  Scott Robertson [sroberts@codeit.com] 
6  *) Allow requests for URLs such as /server/some/other/qualifier to match a
7     FastCGI server defined as /server.  This was done primarily for Java
8         Servlets, but is generically useful.
10  *) Change the comm between the PM and the request handlers from a regular
11     file to a pipe and an assortment of other dynamic fixes.
13  *) Log dynamic process termination scheduling and the resulting 
14     process exit notification.
16  *) Change the default singleThreshhold from 10 to 0 to prevent the last dynamic
17     application process from being killed off due to low demand.
19  *) Clean up FastCGI application pathnames (e.g. remove duplicate slashes). 
21  *) Fix bugs that prevented dynamic processes from being shutdown when
22     the load subsided.  Lars Heete [heete@do.isst.fhg.de]
24  *) Prevent dynamic processes from being scheduled to be started before
25     the init-start-delay or restart-delay period expires.  This prevents
26         the queuing of process start requests while an application which has
27         a long initialization period starts up.
29  *) When suexec is enabled, allow the process manager to become root again in
30     order to signal applications it spawned.
32  *) Change the "server started" log message level from INFO to WARN.
34  *) Fix dynamic server "Connection Refused" handling.
36  *) Fix demand-based dynamic process spawing (uses a more portable approach).
38  *) Add -idle-timeout arg to FastCgiServer, FastCgiExternalServer, and
39     FastCgiConfig.  mod_fastcgi will now abort a connection if inactive for
40         longer than this period.  It applies to the initiation of connections as
41         well (and thus is similar to appConnTimeout).  Default is 30 seconds.
43  *) appConnTimeout is 0 by default now resulting in blocking connect()s.  This
44     is more platform portable/predicable.
46  *) Leave STDOUT and STDERR open to the main server error_log.  This should
47     eliminate a pile of protocol errors and having to track down 3rd party
48     libs writing to stderr inadvertantly.  This doesn't mean these shouldn't
49     be fixed in the application to use the FastCGI I/O, it just allows these
50     applications to run when previously they'd crash and burn.
52  *) Add the pass-header arg to server directives.
54  *) Allow supplementary groups to be passed to spawned FastCGI applications (as
55     is done for CGI) - at least until PR2580 is resolved.
57  *) Initialize the default (empty) environment in a more socially acceptable
58     way.
60  *) Miscellaneous doc improvements based on notes I've collected up over the
61     last few months.
63  *) Fix a bug in the stderr handling introduced in 2.2.2.  There were conditions
64     that resulted in not or improperly terminated strings.
66  *) Fix the call to setsockopt() to disable Nagle.  [based on a bug report by
67     Johannes Plassmann <johannes.plassmann@pdb.siemens.de>]
69 Changes with mod_fastcgi 2.2.2
71  *) Added support for blocking connect()s by setting appConnTimeout to 0.
72     Non-blocking connect()s (the default) can be troublesome on some platforms.
73     Its expected that blocking connect()s will become the default (and
74     non-blocking connect()s will become optional) in the next release.
76  *) Dump a compile time error if the version of Apache is too old.
78  *) Wrap the SIGPIPE handler manipulation code such that it is only applicable
79     to Apache releases prior to 1.3.6.
81  *) Minor tweaks for RUSSIAN_APACHE.  [Sergey Gershtein <sg@mplik.ru>]
83  *) Dynamic updates:
85     Always restart a failed dynamic application if it is the last instance.
86     This means there once started there will always be at least one process
87     instance of a dynamic application.
89     Send PLEASE_START to the PM when a connect() results in an ECONNREFUSED.
90     ECONNREFUSED means the listen queue is full (or there isn't one).  Asking
91     the PM to start (another) application instance may help empty it faster.
93     Change two sleep() calls to select() based snoozes because alarm() is in
94     effect and sleep() and alarm() don't always play nice together.
96     Fixed a couple of error messages.
98  *) Fix -listen-queue-depth arg on FastCgiConfig (dynamic).  Previously it
99     was ignored and the default was always used.
101  *) Allow the -initial-env argument to be used to pass variables from the
102     Apache process environment to the FastCGI server (by specifying a
103     variable name without the "=" or a value).  [suggested by
104     Martin Lichtin <lichtin@oanda.com>]
106  *) Cleanup some debug macros.
108  *) Improved script stderr handling.  [based on suggestions by
109     David Birnbaum <davidb@chelsea.net>]
111  *) Added IRIX and FreeBSD to the list of supported platforms and other minor
112     updates to the INSTALL doc.
114  *) Changed the default listen-queue-depth (FCGI_DEFAULT_LISTEN_Q) from
115     5 to 100.  Its still configurable with the -listen-queue-depth option.
116     This should help eliminate the FAQ - Why do I see "Connection Refused"
117     messages in the log?
119  *) Fix a bug in FastCgiExternalServer that broke support for external servers
120     on other hosts.  [Dave Neuer <dneuer@futuristics.net>]
122 Changes with mod_fastcgi 2.2.1
124  *) Updates to the INSTALL doc to describe building as a DSO.
126  *) If the FastCgiIpcDir directive was in use and "httpd -t" was issued while
127     Apache was running ("apachectl restart" does this), the contents of the
128     dynamic directory (dynamic sockets and the mbox) would be blown away
129     (a 2.1b1 bug).
131  *) Add an extern declaration for ap_sys_siglist (its exposed but not in any
132     Apache header file) to prevent a compile error on systems without
133     SYS_SIGLIST defined.
135  *) During auth requests, the subprocess_env table was left holding variables
136     sent to the auth FastCGI server (including REMOTE_PASSWD!) which means they
137     were passed to other processing phases (such as CGI/FastCGI).  The
138     subprocess_env is now restored to its pre-auth condition.
140  *) Added a FastCGI Authorizer Role compatibility mode which implements the
141     specification to the tee.  Use -compat arg with any of the Auth server
142     directives.  This is intended for new and existing FastCGI authorizer
143     applications that require compatibility with other server implementations.
145  *) Fix logging from the process manager.  Previously, all calls to the
146     logging routines used NULL for the server_rec.  This works fine in a dev
147     environment, but results in most of these messages being tossed by
148     log_error_core() because DEFAULT_LOGLEVEL is too low.  Odd logic.
150  *) Always setup fr->header so that in the event the FastCGI server
151     doesn't get a valid FastCGI protocol header over the wire, we
152     can still print our error message to the log from do_work().
154  *) Fix a compile error in open_connection_to_fs() on systems with TCP_NODELAY
155     defined (Don Locrasto [locrasto@iceminer.com]).
157 Changes with mod_fastcgi 2.2.0
159  *) Serious rewrite of mod_fastcgi.html.  An example conf will have
160     to wait until another time - I'm burned out on docs updates.
162  *) Add to the mod_fastcgi to the server version string.
164  *) SCO doesn't like the const in the arg to inet_addr() and
165     gethostbyname().
167  *) Use Apache's NET_SIZE_T to get the correct arg type for getsockopt().
169  *) Deleted redundant header files from fcgi.h.
171  *) Full path names are no longer required for directives which take
172     file names as arguments.  Like other Apache directives you can
173     specify paths from server_root (don't start with a "/").
175  *) The fcgiKillMgr is gone.  This intermediate process sat between
176     the Apache parent and the FastCGI Process Manager under Apache
177     1.2.         The process manager tries to name itself fcgi_pm (it used
178     to be fcgiProcMgr).
180  *) Authentication, Authorization, and Access phases are now
181     supported. I've bent the FastCgi spec a bit: as many of the standard
182     environment variables (that were easy) are sent (the spec says don't
183     send some by name), all headers (except Status) sent by the auth
184     FastCgi server are passed to subprocesses (CGI/FastCGI invocations)
185     as environment variables rather than just those prefixed by
186     "Variable-".  Custom responses for auth failures aren't supported
187     (yet.. we'll see what the demand for this is like).  In addition to
188     the FastCGI protocol defined environment variable "FCGI_ROLE" being
189     set to "AUTHORIZER" an environment variable "FCGI_APACHE_ROLE" is
190     set indicating which of the three phases is being processed.  See
191     the docs for info on the new per-directory directives:
193         FastCgiAuthenticator, FastCgiAuthenticatorAuthoritative,
194         FastCgiAuthorizer, FastCgiAuthorizerAuthoritative,
195         FastCgiAccessChecker, FastCgiAccessCheckerAuthoritative
197  *) The code has been broken into logical chunks making figuring it
198     out much easier.  All of the #defines a user may want to change are
199     now in mod_fastcgi.h.
201  *) All the logging has been converted to the "supported" Apache
202     logging routines, ap_log_error() and ap_log_rerror().  Log entries
203     for request specific errors should now be directed to the correct
204     server errorlog (if your running more than one).  Some attempt has
205     been made at setting appropriate log levels (comments of course are
206     welcome) and printing errno info when its of value.  All of log
207     messages now have "FastCGI" in them (nice for grep).
209  *) All of the calls to Apache routines have been updated to the ap_
210     convention, eliminating the need for the compat header.
212  *) By default we no longer flush every piece of data we get from the
213     FastCGI server to the client.  This allows the FastCGI server to
214     release without having to wait for the client flush to complete.
215     The old behaviour can revived with the -flush argument to AppClass.
217  *) I renamed some of the directives for consistency (the old names
218     still work).
220         AppClass -> FastCgiServer,
221         FCGIConfig -> FastCgiConfig,
222         ExternalAppClass -> FastCgiExternalServer
224  *) Directive arguments are no longer case sensitive.
226  *) The module now uses hard_timeout() rather than soft_timeout.  This
227     means that the module will longjump out of the request if the
228     drop-dead timeout expires (set with Apache's Timeout directive, the
229     default is 5min) or if the client closes the connection (SIGPIPE).
230     This is more typical for a Apache modules and I'm not convinced we
231     properly handle all of the error cases well enough to use
232     soft_timeout (I can think of one place we don't anyway). This means
233     your FastCGI application can see SIGPIPE.
235  *) SIGPIPE is now ignored by default in FastCGI servers spawned by
236     Apache.  Without this the default behaviour is exit().
238  *) It should (I think) run now under DSO now.
240  *) The bug which prevented sending of binary data in 2.1b1 is fixed.
242  *) The broken -initial-env bug ins 2.1b1 is fixed.
244  *) Maybe some other stuff.
248 *** Well there's a big gap here.  Maybe I'll go back and extract the CVS
249 commit notes and stick 'em in here.. when I get some free time. ;)
251     --robs  (8 Feb 99)
254 *** Originally from docs/README..
256 Apache[X1.03.01]/mod_fastcgi[02.00.05] 19970909 unsupported
257 From: Stanley Gambarin <stanleyg@cs.bu.edu>
259  *) Yet more changes to the source distribution.  Separated out
260     the Tcl dynamic string and buffer libraries into separate files.
261     Did the same for the OS library, however, it is not really an
262     abstraction... more like a bunch of wrappers.  Added to DEVNOTES
263     a note about the problem of Apache not allowing including header
264     file more than once.
266 Apache[X1.03.01]/mod_fastcgi[02.00.04] 19970908 unsupported
267 From: Stanley Gambarin <stanleyg@cs.bu.edu>
269  *) More changes to the installation scripts.  Theoretically we
270     should be able to to use the same Makefile/installation script
271     for both Apache 1.2.x and 1.3.x.  Need some sort of the abstraction
272     layer to use the same source code for both 1.2.x and 1.3.x sources.
274 Apache[X1.03.01]/mod_fastcgi[02.00.03] 19970905 unsupported
275 From: Stanley Gambarin <stanleyg@cs.bu.edu>
277  *) Created Makefile to compile the module into the archive library,
278     just like the proxy module.  Also initial draft of the installation
279     script, which should work for both 1.2 and 1.3 sources of Apache.
281 Apache[01.02.04]/mod_fastcgi[02.00.02] 19970903 unsupported
282 From: Stanley Gambarin <stanleyg@cs.bu.edu>
284  *) More source reorg.  Separated out some header files.  Need much
285     more work on this.  Updated the TODO file.  Added fcgivers.h and
286     CHANGES     file to track the history.
288 Apache[01.02.04]/mod_fastcgi[02.00.01] 19970902 unsupported
289 From: Stanley Gambarin <stanleyg@cs.bu.edu>
291  *) Source reorganization.  This is done to provide a basis for later
292     functionality implementation.  See TODO file for more information
293     of what possible future enhancements are possible/desired.
295 Apache[01.02.04]/mod_fastcgi[02.00.00] 19970902 unsupported
296 From:  David MacKenzie <djm@va.pubnix.com>
298  *) Create the "dynamic" dir and "mbox" as the user specified in the
299     User and Group directives instead of as root.  They are created with
300     restrictive permissions, and then the module checks to see whether the
301     user specified in the User and Group directives has read, write, and
302     execute permissions on them.  Those permissions had been explicitly
303     denied by creating them as "root".
305  *) Some documentation was garbled or incomplete.
307  *) When a FastCGI application can't be execl'd, the code used a
308     value of errno that may have been stomped on by intervening system
309     calls.  That happened on BSD/OS 2.1, where the error_log was
310     reporting errno=25 (NOTTY) instead of the correct errno=13 (EACCES).
311     An intervening stdio call was setting errno as a side-effect, which
312     it has the right to do.
314  *) Erroneous fprintf arguments, a missing return value, an unused
315     function, missing declarations, and other problems detected by gcc
316     -Wall.
318  *) Duplicated code to create the lock file name merged into a single
319     function, closing several memory leaks.
321  *) FCGIConfig -minProcesses didn't allow a value of 0, so the last
322     FCGI app in a given dynamic class would live forever, even if it
323     hadn't been requested for weeks.
325  *) The test for whether to keep looking for dynamic app victims to
326     kill was backwards, so no dynamic apps were ever selected as
327     victims.
329  *) The killInterval and updateInterval were being ignored; the
330     sigsuspend() forced recalculations only when a child died,
331     instead of at the intervals specified.
333  *) When a dynamic app couldn't be started, the program SEGV'd when
334     trying to free the ipcAddrPtr twice.
336  *) Remove the dead lock file and socket when cleaning up after a
337         server whose last child has been killed, so the FastCGIHandler
338     isn't fooled into thinking there is still a process serving
339     that app.
341  *) Make file locking robust in the presence of signals.
343  *) Rename some badly named variables.
345  *) Fix typos in many comments.
347  *) Fix some memory and file descriptor leaks.
349  *) Make the blocking kill of a server closer to working.
351  *) More fixes to calculations in dynamic application management.
354 *** Originally from docs/README.OMI..
356 What's New: Version 2.0b1, 16 Apr 1997
358  *) Implemented a mechanism by which FastCGI applications are started by
359     the web server on the first request and continue running.  Also,  a
360     heuristics have been implemented to allow for dynamic killing of the
361     running FastCGI apps.  The configuration options are supplied via
362         the new FCGIConfig directive, that is described in the
363         mod_fastcgi.html
365  *) When performing internal redirect, since the original request's body
366     has already been read, do not allow the redirected request to think
367     that is has one [body].
369  *) More conditional compilation for OS/2.
371  *) Fixed occassional  "Assertion failed: len > 0, file mod_fastcgi.c"
373  *) Fixed "failed assertion `count >= 0 && count <= bufPtr->length'"
375  *) Added bflush() call after bwrite() in DrainReqOutBuf function to
376     force some output to be written in the period of inactivity. This
377     circumvents the Apache's buffering during the server-push.
379  *) Added a header-parser function placeholder for compatibility with an
380     Apache source code.
382  *) Additional checks have been placed with regard to permissions of the
383     FastCGI processes.  These include the existence of the  file,
384     ExecCGI and IncludesNOEXEC checks, disallowing of nph- scripts, etc.
386  *) Implemented a restart cleanup, so that no parentlesses FastCGI
387         applications are left after Apache is restarted and/or terminated.
388         This was accomplished via two independent mechanisms, where the
389         first one prevents a start of the process manager on the first
390         reading of the configuration files.  The second mechanism deals away
391         from Apache's  implementation of fork() (via spawn_child()) and
392         implements its own forking, thus removing any dependencies on the
393         Apache to cleanup  processes during termination phase.
395  *) Removed the definition of the Sigfunc, as Apache 2.0b10 defines it
396     itself in the file conf.h
398 What's New: Version 1.4.3, 15 Jan 1997
400  *) Fixed compilation warnings for various platforms, as well as
401         conditional compilation for OS/2.
403 What's New: Version 1.4.2, 12 Dec 1996
405  *) mod_fastcgi.c is ported to Apache 1.2b.  Any further development
406         will proceed under this version of Apache web server.
408  *) As the result of porting, the "include virtual" construct of SSI
409         will now work correctly using either <Location> or <Directory>
410         directive.
412 What's New: Version 1.4.1, 4 Dec 1996
414  *) Checks have been removed from the ScanCGIHeaders that provided
415     for the presence of both Status and Location headers as being
416     an error.  Contradictory to CGI/1.1 Internet Draft, both of
417     these headers are used by the current CGI applications.
419 What's New: Version 1.4, 22 Nov 1996
421  *) Added the -port option to AppClass, allowing TCP/IP communication.
422     Added the -socket option to AppClass, allowing Unix domain
423     communication via a configurable pathname.
425  *) Added the ExternalAppClass directive, allowing TCP/IP
426     communication with remote FastCGI applications.
428  *) The handler had its own code for generating HTTP response headers;
429     now it uses Apache's.  This reduces the size of the module.
430     More importantly, it fixes the bug in which "include virtual"
431     sees the HTTP response headers.
433  *) The response header parser performed very little checking.
434     Now the parser enforces the guidelines in the CGI/1.1
435     Internet-Draft: Status and Location are mutually exclusive,
436     Location can only be a response to GET or HEAD,
437     CGI response headers can't be repeated, etc.  (The CGI response
438     headers are the ones the handler interprets: Status, Location,
439     and Content-type.)
441  *) The response header parser used to miss CGI headers
442     with no whitespace after the colon, e.g. "Status:200 OK".
444  *) The response header parser sometimes interpreted the first line
445     of content as an RFC822 continuation line.
447  *) The handler implemented a nonstandard version of Location
448     which never used internal redirects.  The handler
449     now attempts to implement Location as specified in the
450     CGI/1.1 Internet-Draft.  The module documentation explains
451     the new behavior.
453  *) Error log entries from the response header parser were
454     pretty uninformative; they are better now.  If a header is
455     malformed, the log entry includes it.  If the headers are
456     unterminated rather than malformed, the log entry says that,
457     and says how many bytes were received from the app.
459  *) When the application manager forked a new process, and that
460     process ran into trouble before executing the first instruction
461     of application code, the process used to exit with status =
462     errno.  This made certain configuration problems (e.g. incorrect
463     file permissions when server parent is root) quite difficult
464     to pin down.  Now the failing child process opens up the error log
465     and writes an informative entry before exiting.
467  *) The module now correctly handles a slash at the end of the
468     DocumentRoot directive.  This was a one-line fix.
470 What's New: Version 1.3.3, 17 Oct 1996
472  *) The module now registers its request handler under the name
473     fastcgi-script in addition to the name application/x-httpd-fcgi.
474     This was a one-line addition to the module, but had quite
475     a large impact on the documentation and sample configuration.
477 What's New: Version 1.3.2, 27 Sept 1996
479  *) On some systems (SunOS, Linux?), fopen for append has a bug
480     that strikes when two processes append to the same file.
481     This bug causes the process manager to corrupt the error log.
482     Work around the bug by calling open, then fdopen.  A patch
483     to Apache 1.1.1 is also required, as described in mod_fastcgi.html.
484     (Reported by Bob Ramstad.)
486 What's New: Version 1.3.1, 17 Sept 1996
488  *) On Linux and SunOS, the Apache default user_id (-1) is not a
489     legal value of uid_t, so cast it.  (Reported by Bob Ramstad,
490     Scott Langley, others.)
492  *) On some systems (Linux, some Solaris?, Irix?), connect requires
493     write access to a Unix Domain socket, so provide it.  (Reported
494     by Scott Langley, freeform@wired.com, others.)
496  *) If you hit a .fcg file, but there's no AppClass defined, the
497     error should be NOT_FOUND instead of SERVER_ERROR.  (Reported
498     by Michael Smith.)
500 What's New: Version 1.3, 4 Sept 1996
502  *) Module sometimes busy-waited in FastCgiDoWork.  Fixed.
504  *) Module violated the Apache buff abstraction.
505     Fixed.  Might now work with SSL (not tested).
506     As part of the fix, eliminated support for
507     Apache 1.0x versions.
509  *) Module failed to chmod the Unix domain listening sockets
510     it created, so protections were set according to the current
511     umask.  Fixed.
513  *) Module forked too many process manager processes: One
514     per AppClass.  When the Apache parent ran as root, these
515     process manager processes ran as root.  New process
516     manager is a single process (only started if AppClass is
517     used) and runs with same privileges as other children.
518     The new process manager doesn't do any polling, so
519     there's less system overhead than before.
521  *) AppClass insisted on getting at least two arguments.  Fixed.
523  *) Module used setjmp/longjmp, causing compiler warnings
524     on some platforms (e.g. Linux.)  The module no longer
525     uses setjmp/longjmp.
527  *) Module created listening sockets in /tmp, where they were
528     sometimes wiped out by cleanup scripts.  Added FastCgiIpcDir
529     directive to give control over the location of listening
530     sockets.
532  *) Module wrote error log entries without a timestamp.  Fixed.
534  *) AppClass directive wrote error messages to stderr in addition
535     to returning a char * message to the Apache core.  Fixed.
537 What's New: Version 1.2, 3 June 1996
539  *) Ported from Apache-1.0-based code to Apache-1.1b2 internals by
540     Ralf S. Engelschall
541     <rse@en.muc.de>
542     Add version string: APACHEVERSION macro to mod_fastcgi.c
544  *) chown FastCGI socket to user_id and setuid to user_id for app
545     class processes
547  *) Modify GetFromStream() by having it call an OS dependent
548     function GetStreamSize(FILE *) which uses FILE internal data member.
549     Linux users might need to modify GetStreamSize().
551 What's New: Version 1.1, 10 May 1996
553  *) If you specify a non-existent executable in the AppClass directive,
554         or if the file exists and it does not have execute permission you
555         get a constant stream of error messages telling you that "program
556         terminated due to a signal".
558  *) The mod_fastcgi module should use the standard Apache error logging
559         facility instead of writing to stderr.
561 Version 1.0, 30 April 1996