php-src/sapi/thttpd
Sascha Schumann a8136b4dba Defend against pipelined requests on persistent connections as used by
IRCG. These could cause thttpd to start a second request in the same
connection context, and thereby causing real damage.

Mozilla 1.0.1 is buggy in that context: When HTTP/1.1 pipelining is
enabled (defaults to off), it will send any number of requests over
a persistent connection (which is fine), even after it has received
a "Connection: close" header field in a subsequent response header.
This blatantly violates RFC 2616, section 8.1.2. Because it cannot
receive any response on the dead connection, the download manager
pops up and tries to download a file (which never arrives).

Also, we don't try to send a 400 message anymore, if the connection
dies.
2002-11-10 15:21:13 +00:00
..
config.m4 Remove set .x 2002-10-13 11:28:34 +00:00
CREDITS 2nd step towards auto-credits 2000-11-20 10:33:33 +00:00
php_thttpd.h experimental .phps support 2002-10-26 20:55:41 +00:00
php.sym Add SAPI module for thttpd server. Quote from the README: 1999-12-20 07:11:14 +00:00
README Add two missing entries 2002-11-07 11:38:03 +00:00
stub.c Fix building thttpd SAPI module. 2000-08-07 13:54:35 +00:00
thttpd_patch Defend against pipelined requests on persistent connections as used by 2002-11-10 15:21:13 +00:00
thttpd.c s/PHP_API/PHP_API_VERSION/ 2002-11-08 13:29:32 +00:00

README FOR THTTPD MODULE (by Sascha Schumann)        
($Date$)

	This is a SAPI module for PHP 4.x supporting thttpd, the tiny,
	turbo, throttling HTTP server by Jef Poskanzer.

	NOTE: All requests will be serialized. That means, one long running
	      script will block all other requests. Choose another web server,
	      if you want to execute arbitrary scripts.

	The module contains a patch against version 2.21b of thttpd. The patch
	fixes a number of bugs and adds some functionality:

	- HTTP/1.1 Persistent Connection/Pipeline Support
	- PHP Scripting (**.php by default)
	- Highlighting PHP Scripts (**.phps by default)
	- Fast Accept Loop
	- Periodic Connection Expiring
	- Fixes the Host: header vulnerability
	- Asynchronous request body handling
	- Fixup for non-blocking send of thttpd-generated responses

	You can configure the filename extensions by creating a config file for
	thttpd and setting these entries:

	phppat=PATTERN
	phpspat=PATTERN

	The PATTERN has the same format as defined here:

		http://acme.com/software/thttpd/options.html#CGI_PATTERN

	"**.php" means: match any file ending in .php in any directory.
	Setting the pattern from the command line is not supported.

	NOTE: This version supports *only* thttpd 2.21b, no prior or later
	version.

	This is a functional and stable module (it runs a large application
	like IMP 2.2.0 without any problems). Its original intention was to
	demonstrate the ability of PHP to work in every web server environment.

REQUIRED DOWNLOADS

	1. thttpd 2.21b (2.20 or +2.22beta will _not_ work)
	   
	   Full Distribution:
	   http://www.acme.com/software/thttpd/thttpd-2.21b.tar.gz
	   
	2. PHP 4.x
	   
	   Download:
	   http://www.php.net/
	   
	   Snapshots from CVS:
	   http://snaps.php.net/


BUILD INSTRUCTIONS

	1. Extract software packages

	   $ gunzip -c thttpd-2.xx.tar.gz | tar xf -
	   $ gunzip -c php-*.tar.gz | tar xf -

	2. Prepare PHP

	   $ cd php-*
	   $ ./configure \
	   		--with-thttpd=../thttpd-2.xx \
			<further PHP options>
	   $ make install
	   $ cd ..
	
	   You can see the list of valid PHP options by executing

	   $ ./configure --help

	3. Configure, compile, install thttpd

	   Now follow the thttpd instructions. The Makefile template of
	   thttpd was changed to automatically use the components
	   required by PHP.