You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2008/07/22 06:35:46 UTC
svn commit: r678637 [17/46] - in
/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd: ./
autom4te.cache/ cygwin/ doc/ openwrt/ src/ tests/ tests/docroot/
tests/docroot/123/ tests/docroot/www/ tests/docroot/www/dummydir/
tests/docroot/www/expire/ ...
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/evhost.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/evhost.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/evhost.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/evhost.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,45 @@
+========================
+Enhanced Virtual-Hosting
+========================
+
+------------------
+Module: mod_evhost
+------------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/08/29 09:43:49 $
+:Revision: $Revision: 1.1 $
+
+:abstract:
+ virtual hosting
+
+.. meta::
+ :keywords: lighttpd, virtual hosting
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+mod_evhost builds the document-root based on a pattern which contains
+wildcards. Those wildcards can represent parts if the submitted hostname
+
+
+::
+
+ %% => % sign
+ %0 => domain name + tld
+ %1 => tld
+ %2 => domain name without tld
+ %3 => subdomain 1 name
+ %4 => subdomain 2 name
+
+ evhost.path-pattern = "/home/www/servers/%3/pages/"
+
+Options
+=======
+
+evhost.path-pattern
+ pattern with wildcards to be replace to build a documentroot
+
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/expire.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/expire.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/expire.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/expire.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,42 @@
+===============================================
+Controlling the Expiration of Content in Caches
+===============================================
+
+------------------
+Module: mod_expire
+------------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/11/03 22:26:05 $
+:Revision: $Revision: 1.2 $
+
+:abstract:
+ mod_expire controls the setting of the the Expire Response header
+
+.. meta::
+ :keywords: lighttpd, expire
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+mod_expire controls the Expire header in the Response Header of HTTP/1.0
+messages. It is usefull to set it for static files which should be cached
+aggressivly like images, stylesheets or similar.
+
+Options
+=======
+
+expire.url
+ assignes a expiration to all files below the specified path. The
+ specification of the time is made up of: ::
+
+ <access|modification> <number> <years|months|days|hours|minutes|seconds>
+
+ following the syntax used by mod_expire in Apache 1.3.x and later.
+
+ Example: ::
+
+ expire.url = ( "/images/" => "access 1 hour" )
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/extforward.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/extforward.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/extforward.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/extforward.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,96 @@
+==============
+mod_extforward
+==============
+
+.. contents::
+
+Overview
+========
+
+Comman Kang <comman.kang at gmail.com> sent me: ::
+
+ Hello jan.
+
+ I've made something rough but similar to mod_extract_forwarded for
+ Apache. This module will extract the client's "real" ip from
+ X-Forwarded-For header which is added by squid or other proxies. It might be
+ useful for servers behind reverse proxy servers.
+
+ However, this module is causing segfault with mod_ssl or
+ $HTTP{''socket"} directive, crashing in config_check_cond while patching
+ connection , I do not understand architecture of the lighttpd well, does it
+ need to call patch_connection in either handle_request_done and
+ connection_reset ?
+
+Lionel Elie Mamane <li...@mamane.lu> improved the patch: ::
+
+ I've taken lighttpd-1.4.10-mod_extforward.c from the wiki and I've
+ extended it. Here is the result.
+
+ Major changes:
+
+ - IPv6 support
+
+ - Fixed at least one segfault with SERVER['socket']
+
+ - Arrange things so that a url.access-deny under scope of a
+ HTTP['remoteip'] condition works well :)
+
+ I've commented the code in some places, mostly where I wasn't sure
+ what was going on, or I didn't see what the original author meant to
+ do.
+
+Options
+=======
+
+extforward.forwarder
+ Sets trust level of proxy IP's.
+
+ Default: empty
+
+ Example: ::
+
+ extforward.forwarder = ("10.0.0.232" => "trust")
+
+ will translate ip addresses coming from 10.0.0.232 to real ip addresses extracted from X-Forwarded-For: HTTP request header.
+
+Note
+=======
+
+The effect of this module is variable on $HTTP["remotip"] directives and other module's remote ip dependent actions.
+Things done by modules before we change the remoteip or after we reset it will match on the proxy's IP.
+Things done in between these two moments will match on the real client's IP.
+The moment things are done by a module depends on in which hook it does things and within the same hook
+on whether they are before/after us in the module loading order
+(order in the server.modules directive in the config file).
+
+Tested behaviours:
+
+ mod_access: Will match on the real client.
+
+ mod_accesslog:
+ In order to see the "real" ip address in access log ,
+ you'll have to load mod_extforward after mod_accesslog.
+ like this: ::
+
+ server.modules = (
+ .....
+ mod_accesslog,
+ mod_extforward
+ )
+
+Samples
+=======
+
+Trust proxy 10.0.0.232 and 10.0.0.232 ::
+
+ extforward.forwarder = (
+ "10.0.0.232" => "trust",
+ "10.0.0.233" => "trust",
+ )
+
+Trust all proxies (NOT RECOMMENDED!) ::
+
+ extforward.forwarder = ( "all" => "trust")
+
+Note that "all" has precedence over specific entries, so "all except" setups will not work.
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.dot
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.dot?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.dot (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.dot Mon Jul 21 21:35:35 2008
@@ -0,0 +1,6 @@
+digraph fcgistate {
+ init -> connect -> prepwrite -> write -> read -> close
+ write -> write
+ read -> read
+ connect -> connect
+}
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi-state.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,51 @@
+=================
+FastCGI Internals
+=================
+
+---------------
+Module: fastcgi
+---------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/08/01 07:01:29 $
+:Revision: $Revision: 1.1 $
+
+:abstract:
+ This is a short summary of the state-engine which is driving the FastCGI
+ module. It describes the basic concepts and the way the different parts
+ of the module are connected.
+
+.. meta::
+ :keywords: lighttpd, state-engine, fastcgi
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+States
+------
+
+The state-engine is currently made of 6 states which are walk-through on
+the way each connection.
+
+:init:
+ prepare fastcgi-connection
+:connect:
+ waiting for a connection
+:prepwrite:
+ build the fastcgi-request
+:write:
+ write the fastcgi-request to the network
+:read:
+ read fastcgi-response from network and push it to the write-queue
+:close:
+ terminate the connection
+
+.. image:: fastcgi-state.png
+
+Delays
+------
+
+connect, write and read may need to wait for an fdevent. That's the reason
+for the loop in the state-diagram.
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/fastcgi.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,606 @@
+=====================
+the FastCGI Interface
+=====================
+
+-------------------
+Module: mod_fastcgi
+-------------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/11/03 22:26:05 $
+:Revision: $Revision: 1.3 $
+
+:abstract:
+ The FastCGI interface is the fastest and most secure way
+ to interface external process-handlers like Perl, PHP and
+ your self-written applications.
+
+.. meta::
+ :keywords: lighttpd, FastCGI
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+lighttpd provides an interface to a external programs that
+support the FastCGI interface. The FastCGI Interface is
+defined by http://www.fastcgi.com/ and is a
+platform-independent and server independent interface between
+a web-application and a webserver.
+
+This means that FastCGI programs that run with the Apache
+Webserver will run seamlessly with lighttpd and vice versa.
+
+
+FastCGI
+-------
+
+FastCGI is removes a lot of the limitations of CGI programs.
+CGI programs have the problem that they have to be restarted
+by the webserver for every request which leads to really bad
+performance values.
+
+FastCGI removes this limitation by keeping the process running
+and handling the requests by this always running process. This
+removes the time used for the fork() and the overall startup
+and cleanup time which is necessary to create and destroy a
+process.
+
+While CGI programs communicate to the server over pipes,
+FastCGI processes use Unix-Domain-Sockets or TCP/IP to talk
+with the webserver. This gives you the second advantage over
+simple CGI programs: FastCGI don't have to run on the Webserver
+itself but everywhere in the network.
+
+lighttpd takes it a little bit further by providing a internal
+FastCGI load-balancer which can be used to balance the load
+over multiple FastCGI Servers. In contrast to other solutions
+only the FastCGI process has to be on the cluster and not the
+whole webserver. That gives the FastCGI process more resources
+than a e.g. load-balancer+apache+mod_php solution.
+
+If you compare FastCGI against a apache+mod_php solution you
+should note that FastCGI provides additional security as the
+FastCGI process can be run under different permissions that
+the webserver and can also live a chroot which might be
+different than the one the webserver is running in.
+
+Options
+=======
+
+lighttpd provides the FastCGI support via the fastcgi-module
+(mod_fastcgi) which provides 2 options in the config-file:
+
+fastcgi.debug
+ a value between 0 and 65535 to set the debug-level in the
+ FastCGI module. Currently only 0 and 1 are used. Use 1 to
+ enable some debug output, 0 to disable it.
+
+fastcgi.map-extensions
+ map multiple extensions to the same fastcgi server
+
+ Example: ::
+
+ fastcgi.map-extensions = ( ".php3" => ".php" )
+
+fastcgi.server
+ tell the module where to send FastCGI requests to. Every
+ file-extension can have it own handler. Load-Balancing is
+ done by specifying multiple handles for the same extension.
+
+ structure of fastcgi.server section: ::
+
+ ( <extension> =>
+ (
+ ( "host" => <string> ,
+ "port" => <integer> ,
+ "socket" => <string>, # either socket
+ # or host+port
+ "bin-path" => <string>, # OPTIONAL
+ "bin-environment" => <array>, # OPTIONAL
+ "bin-copy-environment" => <array>, # OPTIONAL
+ "mode" => <string>, # OPTIONAL
+ "docroot" => <string> , # OPTIONAL if "mode"
+ # is not "authorizer"
+ "check-local" => <string>, # OPTIONAL
+ "min-procs" => <integer>, # OPTIONAL
+ "max-procs" => <integer>, # OPTIONAL
+ "max-load-per-proc" => <integer>, # OPTIONAL
+ "idle-timeout" => <integer>, # OPTIONAL
+ "broken-scriptfilename" => <boolean>, # OPTIONAL
+ "disable-time" => <integer>, # optional
+ "allow-x-send-file" => <boolean> # optional
+ ),
+ ( "host" => ...
+ )
+ )
+ )
+
+ :<extension>: is the file-extension or prefix
+ (if started with "/")
+ :"host": is hostname/ip of the FastCGI process
+ :"port": is tcp-port on the "host" used by the FastCGI
+ process
+ :"bin-path": path to the local FastCGI binary which should be
+ started if no local FastCGI is running
+ :"socket": path to the unix-domain socket
+ :"mode": is the FastCGI protocol mode.
+ Default is "responder", also "authorizer"
+ mode is implemented.
+ :"docroot": is optional and is the docroot on the remote
+ host for default "responder" mode. For
+ "authorizer" mode it is MANDATORY and it points
+ to docroot for authorized requests. For security
+ reasons it is recommended to keep this docroot
+ outside of server.document-root tree.
+ :"check-local": is optional and may be "enable" (default) or
+ "disable". If enabled the server first check
+ for a file in local server.document-root tree
+ and return 404 (Not Found) if no such file.
+ If disabled, the server forward request to
+ FastCGI interface without this check.
+ :"broken-scriptfilename": breaks SCRIPT_FILENAME in a wat that
+ PHP can extract PATH_INFO from it (default: disabled)
+ :"disable-time": time to wait before a disabled backend is checked
+ again
+ :"allow-x-send-file": controls if X-LIGHTTPD-send-file headers
+ are allowed
+
+ If bin-path is set:
+
+ :"min-procs": sets the minium processes to start
+ :"max-procs": the upper limit of the processess to start
+ :"max-load-per-proc": maximum number of waiting processes on
+ average per process before a new process is
+ spawned
+ :"idle-timeout": number of seconds before a unused process
+ gets terminated
+ :"bin-environment": put an entry into the environment of
+ the started process
+ :"bin-copy-environement": clean up the environment and copy
+ only the specified entries into the fresh
+ environment of the spawn process
+
+
+Examples
+--------
+
+ Multiple extensions for the same host ::
+
+ fastcgi.server = ( ".php" =>
+ (( "host" => "127.0.0.1",
+ "port" => 1026,
+ "bin-path" => "/usr/local/bin/php"
+ )),
+ ".php4" =>
+ (( "host" => "127.0.0.1",
+ "port" => 1026
+ ))
+ )
+
+ Example with prefix: ::
+
+ fastcgi.server = ( "/remote_scripts/" =>
+ (( "host" => "192.168.0.3",
+ "port" => 9000,
+ "check-local" => "disable",
+ "docroot" => "/" # remote server may use
+ # it's own docroot
+ ))
+ )
+
+ The request `http://my.host.com/remote_scripts/test.cgi` will
+ be forwarded to fastcgi server at 192.168.0.3 and the value
+ "/remote_scripts/test.cgi" will be used for the SCRIPT_NAME
+ variable. Remote server may prepend it with its own
+ document root. The handling of index files is also the
+ resposibility of remote server for this case.
+
+ In the case that the prefix is not terminated with a slash
+ the prefix will be handled as file and /test.cgi would become
+ a PATH_INFO instead of part of SCRIPT_NAME.
+
+
+ Example for "authorizer" mode: ::
+
+ fastcgi.server = ( "/remote_scripts/" =>
+ (( "host" => "10.0.0.2",
+ "port" => 9000,
+ "docroot" => "/path_to_private_docs",
+ "mode" => "authorizer"
+ ))
+ )
+
+ Note that if "docroot" is specified then its value will be
+ used in DOCUMENT_ROOT and SCRIPT_FILENAME variables passed
+ to FastCGI server.
+
+Load-Balancing
+==============
+
+The FastCGI plugin provides automaticly a load-balancing between
+multiple FastCGI servers. ::
+
+ fastcgi.server = ( ".php" =>
+ (( "host" => "10.0.0.2", "port" => 1030 ),
+ ( "host" => "10.0.0.3", "port" => 1030 ))
+ )
+
+
+To understand how the load-balancing works you can enable the
+fastcgi.debug option and will get a similar output as here: ::
+
+ proc: 127.0.0.1 1031 1 1 1 31454
+ proc: 127.0.0.1 1028 1 1 1 31442
+ proc: 127.0.0.1 1030 1 1 1 31449
+ proc: 127.0.0.1 1029 1 1 2 31447
+ proc: 127.0.0.1 1026 1 1 2 31438
+ got proc: 34 31454
+ release proc: 40 31438
+ proc: 127.0.0.1 1026 1 1 1 31438
+ proc: 127.0.0.1 1028 1 1 1 31442
+ proc: 127.0.0.1 1030 1 1 1 31449
+ proc: 127.0.0.1 1031 1 1 2 31454
+ proc: 127.0.0.1 1029 1 1 2 31447
+
+Even if this for multiple FastCGI children on the local machine
+the following explaination is valid for remote connections too.
+
+The output shows:
+
+- IP, port, unix-socket (is empty here)
+- is-local, state (0 - unset, 1 - running, ... )
+- active connections (load)
+- PID
+
+As you can see the list is always sorted by the load field.
+
+Whenever a new connection is requested, the first entry (the one
+with the lowest load) is selected, the load is increased (got proc: ...)
+and the list is sorted again.
+
+If a FastCGI request is done or the connection is dropped, the load on the
+FastCGI proc decreases and the list is sorted again (release proc: ...)
+
+This behaviour is very light-weight in code and still very efficient
+as it keeps the fastcgi-servers equally loaded even if they have different
+CPUs.
+
+Adaptive Process Spawning
+=========================
+
+.. note:: This feature is disabled in 1.3.14 again. min-procs is
+ ignored in that release
+
+Starting with 1.3.8 lighttpd can spawn processes on demand if
+a bin-path is specified and the FastCGI process runs locally.
+
+If you want to have a least one FastCGI process running and
+more of the number of requests increases you can use min-procs
+and max-procs.
+
+A new process is spawned as soon as the average number of
+requests waiting to be handle by a single process increases the
+max-load-per-proc setting.
+
+The idle-timeout specifies how long a fastcgi-process should wait
+for a new request before it kills itself.
+
+Example
+-------
+::
+
+ fastcgi.server = ( ".php" =>
+ (( "socket" => "/tmp/php.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "min-procs" => 1,
+ "max-procs" => 32,
+ "max-load-per-proc" => 4,
+ "idle-timeout" => 20
+ ))
+ )
+
+Disabling Adaptive Spawning
+---------------------------
+
+Adaptive Spawning is a quite new feature and it might misbehave
+for your setup. There are several ways to control how the spawing
+is done:
+
+1. ``"max-load-per-proc" => 1``
+ if that works for you, great.
+
+2. If not set ``min-procs == max-procs``.
+
+3. For PHP you can also use: ::
+
+ $ PHP_FCGI_CHILDREN=384 ./lighttpd -f ./lighttpd.conf
+
+ fastcgi.server = ( ".php" =>
+ (( "socket" => "/tmp/php.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "min-procs" => 1,
+ "max-procs" => 1,
+ "max-load-per-proc" => 4,
+ "idle-timeout" => 20
+ ))
+ )
+
+ It will create one socket and let's PHP create the 384 processes itself.
+
+4. If you don't want lighttpd to manage the fastcgi processes, remove the
+ bin-path and use spawn-fcgi to spawn them itself.
+
+
+FastCGI and Programming Languages
+=================================
+
+Preparing PHP as a FastCGI program
+----------------------------------
+
+One of the most important application that has a FastCGI
+interface is php which can be downloaded from
+http://www.php.net/ . You have to recompile the php from
+source to enable the FastCGI interface as it is normally
+not enabled by default in the distributions.
+
+If you already have a working installation of PHP on a
+webserver execute a small script which just contains ::
+
+ <?php phpinfo(); ?>
+
+and search for the line in that contains the configure call.
+You can use it as the base for the compilation.
+
+You have to remove all occurences of `--with-apxs`, `--with-apxs2`
+and the like which would build PHP with Apache support. Add the
+next three switches to compile PHP with FastCGI support::
+
+ $ ./configure \
+ --enable-fastcgi \
+ --enable-force-cgi-redirect \
+ ...
+
+After compilation and installation check that your PHP
+binary contains FastCGI support by calling: ::
+
+ $ php -v
+ PHP 4.3.3RC2-dev (cgi-fcgi) (built: Oct 19 2003 23:19:17)
+
+The important part is the (cgi-fcgi).
+
+
+Starting a FastCGI-PHP
+----------------------
+
+Starting with version 1.3.6 lighttpd can spawn the FastCGI
+processes locally itself if necessary: ::
+
+ fastcgi.server = ( ".php" =>
+ (( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php"
+ ))
+ )
+
+PHP provides 2 special environment variables which control the number of
+spawned workes under the control of a single watching process
+(PHP_FCGI_CHILDREN) and the number of requests what a single worker
+handles before it kills itself. ::
+
+ fastcgi.server = ( ".php" =>
+ (( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "16",
+ "PHP_FCGI_MAX_REQUESTS" => "10000"
+ )
+ ))
+ )
+
+To increase the security of the started process you should only pass
+the necessary environment variables to the FastCGI process. ::
+
+ fastcgi.server = ( ".php" =>
+ (( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "16",
+ "PHP_FCGI_MAX_REQUESTS" => "10000" ),
+ "bin-copy-environment" => (
+ "PATH", "SHELL", "USER" )
+ ))
+ )
+
+Configuring PHP
+---------------
+
+If you want to use PATH_INFO and PHP_SELF in you PHP scripts you have to
+configure php and lighttpd. The php.ini needs the option: ::
+
+ cgi.fix_pathinfo = 1
+
+and the option ``broken-scriptfilename`` in your fastcgi.server config: ::
+
+ fastcgi.server = ( ".php" =>
+ (( "socket" => "/tmp/php-fastcgi.socket",
+ "bin-path" => "/usr/local/bin/php",
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "16",
+ "PHP_FCGI_MAX_REQUESTS" => "10000" ),
+ "bin-copy-environment" => (
+ "PATH", "SHELL", "USER" ),
+ "broken-scriptfilename" => "enable"
+ ))
+ )
+
+Why this ? the ``cgi.fix_pathinfo = 0`` would give you a working ``PATH_INFO``
+but no ``PHP_SELF``. If you enable it, it turns around. To fix the
+``PATH_INFO`` `--enable-discard-path` needs a SCRIPT_FILENAME which is against the CGI spec, a
+broken-scriptfilename. With ``cgi.fix_pathinfo = 1`` in php.ini and
+``broken-scriptfilename => "enable"`` you get both.
+
+
+External Spawning
+-----------------
+
+Spawning FastCGI processes directly in the webserver has some
+disadvantages like
+
+- FastCGI process can only run locally
+- has the same permissions as the webserver
+- has the same base-dir as the webserver
+
+As soon as you are using a seperate FastCGI Server to
+take off some load from the webserver you have to control
+the FastCGI process by a external program like spawn-fcgi.
+
+spawn-fcgi is used to start a FastCGI process in its own
+environment and set the user-id, group-id and change to
+another root-directory (chroot).
+
+For convenience a wrapper script should be used which takes
+care of all the necessary option. Such a script in included
+in the lighttpd distribution and is call spawn-php.sh.
+
+The script has a set of config variables you should take
+a look at: ::
+
+ ## ABSOLUTE path to the spawn-fcgi binary
+ SPAWNFCGI="/usr/local/sbin/spawn-fcgi"
+
+ ## ABSOLUTE path to the PHP binary
+ FCGIPROGRAM="/usr/local/bin/php"
+
+ ## bind to tcp-port on localhost
+ FCGIPORT="1026"
+
+ ## bind to unix domain socket
+ # FCGISOCKET="/tmp/php.sock"
+
+ ## number of PHP childs to spawn
+ PHP_FCGI_CHILDREN=10
+
+ ## number of request server by a single php-process until
+ ## is will be restarted
+ PHP_FCGI_MAX_REQUESTS=1000
+
+ ## IP adresses where PHP should access server connections
+ ## from
+ FCGI_WEB_SERVER_ADDRS="127.0.0.1,192.168.0.1"
+
+ # allowed environment variables sperated by spaces
+ ALLOWED_ENV="ORACLE_HOME PATH USER"
+
+ ## if this script is run as root switch to the following user
+ USERID=wwwrun
+ GROUPID=wwwrun
+
+If you have set the variables to values that fit to your
+setup you can start it by calling: ::
+
+ $ spawn-php.sh
+ spawn-fcgi.c.136: child spawned successfully: PID: 6925
+
+If you get "child spawned successfully: PID:" the php
+processes could be started successfully. You should see them
+in your processlist: ::
+
+ $ ps ax | grep php
+ 6925 ? S 0:00 /usr/local/bin/php
+ 6928 ? S 0:00 /usr/local/bin/php
+ ...
+
+The number of processes should be PHP_FCGI_CHILDREN + 1.
+Here the process 6925 is the master of the slaves which
+handle the work in parallel. Number of parallel workers can
+be set by PHP_FCGI_CHILDREN. A worker dies automaticly of
+handling PHP_FCGI_MAX_REQUESTS requests as PHP might have
+memory leaks.
+
+If you start the script as user root php processes will be
+running as the user USERID and group GROUPID to drop the
+root permissions. Otherwise the php processes will run as
+the user you started script as.
+
+As the script might be started from a unknown stage or even
+directly from the command-line it cleans the environment
+before starting the processes. ALLOWED_ENV contains all
+the external environement variables that should be available
+to the php-process.
+
+
+Perl
+----
+
+For Perl you have to install the FCGI module from CPAN.
+
+Skeleton for remote authorizer
+==============================
+
+The basic functionality of authorizer is as follows (see
+http://www.fastcgi.com/devkit/doc/fcgi-spec.html, 6.3 for
+details). ::
+
+ #include <fcgi_stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ int main () {
+ char* p;
+
+ while (FCGI_Accept() >= 0) {
+ /* wait for fastcgi authorizer request */
+
+ printf("Content-type: text/html\r\n");
+
+ if ((p = getenv("QUERY_STRING")) == NULL) ||
+ <QUERY_STRING is unauthorized>)
+ printf("Status: 403 Forbidden\r\n\r\n");
+
+ else printf("\r\n");
+ /* default Status is 200 - allow access */
+ }
+
+ return 0;
+ }
+
+It is possible to use any other variables provided by
+FastCGI interface for authorization check. Here is only an
+example.
+
+
+Troubleshooting
+===============
+
+fastcgi.debug should be enabled for troubleshooting.
+
+If you get: ::
+
+ (fcgi.c.274) connect delayed: 8
+ (fcgi.c.289) connect succeeded: 8
+ (fcgi.c.745) unexpected end-of-file (perhaps the fastcgi
+ process died): 8
+
+the fastcgi process accepted the connection but closed it
+right away. This happens if FCGI_WEB_SERVER_ADDRS doesn't
+include the host where you are connection from.
+
+If you get ::
+
+ (fcgi.c.274) connect delayed: 7
+ (fcgi.c.1107) error: unexpected close of fastcgi connection
+ for /peterp/seite1.php (no fastcgi process on host/port ?)
+ (fcgi.c.1015) emergency exit: fastcgi: connection-fd: 5
+ fcgi-fd: 7
+
+the fastcgi process is not running on the host/port you are
+connection to. Check your configuration.
+
+If you get ::
+
+ (fcgi.c.274) connect delayed: 7
+ (fcgi.c.289) connect succeeded: 7
+
+everything is fine. The connect() call just was delayed a
+little bit and is completly normal.
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/features.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/features.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/features.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/features.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,116 @@
+===============
+progress report
+===============
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/11/03 22:26:05 $
+:Revision: $Revision: 1.2 $
+
+:abstract:
+ This document tries to track the requested features and
+ the release when they have been implemented.
+
+.. meta::
+ :keywords: lighttpd, features
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+The document was inspired by a mail from David Phillips:
+
+http://marc.theaimsgroup.com/?l=thttpd&m=108051453226692&w=2
+
+It is used to see what is still missing and what is already done. ::
+
+ zell@zell.best.vwh.net writes:
+ > Now that the author has made the source code available, I am
+ > considering installing and testing the latest version. From a
+ > quick glance, it seems to support most/all of the features of
+ > Premium thttpd and Zeus.
+
+ If you think it compares to Zeus, then you've obviously never used Zeus.
+
+ lighttpd is currently the only non-blocking open source web server to
+ support FastCGI responders and that's worthwhile.
+
+ The documentation is lacking. Comments in the configuration file do not
+ make up for a complete manual.
+
+Constantly improving. ::
+
+ The configuration syntax is overly complex, like Apache. There is no .htaccess
+ support.
+
+.htaccess support is not planed yet. ::
+
+ There is only one server. You cannot have a separate configuration for each
+ virtual server. This would seem to be especially problematic when doing
+ SSL.
+
+Works since 1.3.0. ::
+
+ There is no SSI support. Zeus has full recursive SSI support. Output from
+ a FastCGI program can get run through the SSI interpreter. SSI can also do
+ virtual includes recursively.
+
+SSI works since 1.2.4. ::
+
+ Request logging is not configurable. Zeus supports fully configurable
+ access logging, plus a binary version of CLF that save space.
+
+1.2.6 adds Apache-like logfile config. ::
+
+ Access control only allows authentication via username and password. There
+ is no way to allow or deny based in IP address.
+
+planed for 1.3.x ::
+
+ The request rewriting appears to only allow regex substitutions. Zeus has a
+ simple, yet powerful, request rewrite language.
+
+
+
+ There is no support for FastCGI authorizers. These are very useful for high
+ traffic sites that require complex authentication schemes or that store
+ authorization information in a central database.
+
+since 1.1.9. ::
+
+ There is no bandwidth throttling support. Zeus does bandwidth throttling
+ correctly (i.e. unlike past versions of thttpd) and can throttle on a
+ per-subserver (thttpd-style virtual hosts) basis.
+
+since 1.3.8. ::
+
+ There is no ISAPI support. ISAPI is an elegant, open API that allows
+ modification of web server behavior. While it isn't strictly necessary for
+ an open source web server, it nice to have a documented, consistent API,
+ rather than having to manually patch the server.
+
+If someone requests it it might be implemented. ::
+
+ There is no web based interface. Zeus has a complete web based interface
+ for everything, including a powerful feature of configuring multiple virtual
+ servers at once.
+
+That is something that should be a special feature of Zeus. :) ::
+
+ There is no support for mapping certain URLs to specific filesystem paths.
+
+since 1.2.6 ::
+
+ There is no referring checking. This is incredibly important to prevent
+ hotlinking of bandwidth intensive media types (images, movies, etc.).
+
+we have something better: mod_secdownload. And if someone wants referer
+checking we have a condition in the config for it since 1.2.9 ::
+
+ Zeus has a lot of features that lighttpd doesn't have, but I only mentioned
+ the ones I care about and use.
+
+ --
+ David Phillips <da...@acz.org>
+ http://david.acz.org/
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.1
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.1?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.1 (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.1 Mon Jul 21 21:35:35 2008
@@ -0,0 +1,18 @@
+.TH LIGHTTPD 1 2003-12-21
+.SH NAME
+lighttpd - a fast, secure and flexible webserver
+.SH SYNOPSIS
+lighttpd -D -f <configfile>
+.SH DESCRIPTION
+.SH FILES
+/etc/lighttpd/lighttpd.conf
+.SH CONFORMING TO
+HTTP/1.0
+HTTP/1.0
+HTTP-Authentification - Basic, Digest
+FastCGI
+CGI/1.1
+.SH SEE ALSO
+spawn-fcgi(1)
+.SH AUTHOR
+jan@kneschke.de
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.conf
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.conf?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.conf (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.conf Mon Jul 21 21:35:35 2008
@@ -0,0 +1,326 @@
+# lighttpd configuration file
+#
+# use it as a base for lighttpd 1.0.0 and above
+#
+# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
+
+############ Options you really have to take care of ####################
+
+## modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.modules = (
+# "mod_rewrite",
+# "mod_redirect",
+# "mod_alias",
+ "mod_access",
+# "mod_cml",
+# "mod_trigger_b4_dl",
+# "mod_auth",
+# "mod_status",
+# "mod_setenv",
+# "mod_fastcgi",
+# "mod_proxy",
+# "mod_simple_vhost",
+# "mod_evhost",
+# "mod_userdir",
+# "mod_cgi",
+# "mod_compress",
+# "mod_ssi",
+# "mod_usertrack",
+# "mod_expire",
+# "mod_secdownload",
+# "mod_rrdtool",
+ "mod_accesslog" )
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root = "/var/www/apache_host/"
+
+## where to send error-messages to
+server.errorlog = "/var/log/lighttpd/error.log"
+
+# files to check for if .../ is requested
+index-file.names = ( "index.php", "index.html",
+ "index.htm", "default.htm" )
+
+## set the event-handler (read the performance section in the manual)
+# server.event-handler = "freebsd-kqueue" # needed on OS X
+
+# mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "application/ogg",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jar" => "application/x-java-archive",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".cpp" => "text/plain",
+ ".log" => "text/plain",
+ ".conf" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar",
+ # default mime type
+ "" => "application/octet-stream",
+ )
+
+# Use the "Content-Type" extended attribute to obtain mime type if possible
+mimetype.use-xattr = "enable"
+
+
+## send a different Server: header
+## be nice and keep it at lighttpd
+server.tag = "lighttpd"
+
+#### accesslog module
+accesslog.filename = "/var/log/lighttpd/access.log"
+
+## deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+$HTTP["url"] =~ "\.pdf$" {
+ server.range-requests = "disable"
+}
+
+##
+# which extensions should not be handle via static-file transfer
+#
+# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+server.port = 9099
+
+## bind to localhost (default: all interfaces)
+server.bind = "127.0.0.1"
+
+## error-handler for status 404
+#server.error-handler-404 = "/error-handler.html"
+#server.error-handler-404 = "/error-handler.php"
+
+## to help the rc.scripts
+#server.pid-file = "/var/run/lighttpd.pid"
+
+
+###### virtual hosts
+##
+## If you want name-based virtual hosting add the next three settings and load
+## mod_simple_vhost
+##
+## document-root =
+## virtual-server-root + virtual-server-default-host + virtual-server-docroot
+## or
+## virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root = "/srv/www/vhosts/"
+#simple-vhost.default-host = "www.example.org"
+#simple-vhost.document-root = "/htdocs/"
+
+
+##
+## Format: <errorfile-prefix><status-code>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix = "/usr/share/lighttpd/errors/status-"
+#server.errorfile-prefix = "/srv/www/errors/status-"
+
+## virtual directory listings
+#dir-listing.activate = "enable"
+
+## enable debugging
+#debug.log-request-header = "enable"
+#debug.log-response-header = "enable"
+#debug.log-request-handling = "enable"
+#debug.log-file-not-found = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username = "www"
+
+## change uid to <uid> (default: don't care)
+#server.groupname = "www"
+
+#### compress module
+#compress.cache-dir = "/var/cache/lighttpd/compress/"
+#compress.filetype = ("text/plain", "text/html")
+
+#### proxy module
+## read proxy.txt for more info
+#proxy.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "host" => "192.168.0.101",
+# "port" => 80
+# )
+# )
+# )
+
+#### fastcgi module
+## read fastcgi.txt for more info
+## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
+#fastcgi.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "socket" => "/var/run/lighttpd/php-fastcgi.socket",
+# "bin-path" => "/usr/local/bin/php-cgi"
+# )
+# )
+# )
+
+#### CGI module
+#cgi.assign = ( ".pl" => "/usr/bin/perl",
+# ".cgi" => "/usr/bin/perl" )
+#
+
+#### SSL engine
+#ssl.engine = "enable"
+#ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
+
+#### status module
+#status.status-url = "/server-status"
+#status.config-url = "/server-config"
+
+#### auth module
+## read authentication.txt for more info
+#auth.backend = "plain"
+#auth.backend.plain.userfile = "lighttpd.user"
+#auth.backend.plain.groupfile = "lighttpd.group"
+
+#auth.backend.ldap.hostname = "localhost"
+#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
+#auth.backend.ldap.filter = "(uid=$)"
+
+#auth.require = ( "/server-status" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "user=jan"
+# ),
+# "/server-config" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "valid-user"
+# )
+# )
+
+#### url handling modules (rewrite, redirect, access)
+#url.rewrite = ( "^/$" => "/server-status" )
+#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+#### both rewrite/redirect support back reference to regex conditional using %n
+#$HTTP["host"] =~ "^www\.(.*)" {
+# url.redirect = ( "^/(.*)" => "http://%1/$1" )
+#}
+
+#
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+#evhost.path-pattern = "/srv/www/vhosts/%3/htdocs/"
+
+#### expire module
+#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+#ssi.extension = ( ".shtml" )
+
+#### rrdtool
+#rrdtool.binary = "/usr/bin/rrdtool"
+#rrdtool.db-name = "/var/lib/lighttpd/lighttpd.rrd"
+
+#### setenv
+#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
+#setenv.add-response-header = ( "X-Secret-Message" => "42" )
+
+## for mod_trigger_b4_dl
+# trigger-before-download.gdbm-filename = "/var/lib/lighttpd/trigger.db"
+# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
+# trigger-before-download.trigger-url = "^/trigger/"
+# trigger-before-download.download-url = "^/download/"
+# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
+# trigger-before-download.trigger-timeout = 10
+
+## for mod_cml
+## don't forget to add index.cml to server.indexfiles
+# cml.extension = ".cml"
+# cml.memcache-hosts = ( "127.0.0.1:11211" )
+
+#### variable usage:
+## variable name without "." is auto prefixed by "var." and becomes "var.bar"
+#bar = 1
+#var.mystring = "foo"
+
+## integer add
+#bar += 1
+## string concat, with integer cast as string, result: "www.foo1.com"
+#server.name = "www." + mystring + var.bar + ".com"
+## array merge
+#index-file.names = (foo + ".php") + index-file.names
+#index-file.names += (foo + ".php")
+
+#### include
+#include /home/dinesh/software/lighttpd/lighttpd.conf
+## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
+#include "lighttpd-inc.conf"
+
+#### include_shell
+#include_shell "echo var.a=1"
+## the above is same as:
+#var.a=1
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.user
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.user?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.user (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/lighttpd.user Mon Jul 21 21:35:35 2008
@@ -0,0 +1 @@
+dummy:test123
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/magnet.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/magnet.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/magnet.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/magnet.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,429 @@
+{{{
+#!rst
+==============
+a power-magnet
+==============
+
+------------------
+Module: mod_magnet
+------------------
+
+
+
+.. contents:: Table of Contents
+
+Requirements
+============
+
+:Version: lighttpd 1.4.12 or higher
+:Packages: lua >= 5.1
+
+Overview
+========
+
+mod_magnet is a module to control the request handling in lighty.
+
+.. note::
+
+ Keep in mind that the magnet is executed in the core of lighty. EVERY long-running operation is blocking
+ ALL connections in the server. You are warned. For time-consuming or blocking scripts use mod_fastcgi and friends.
+
+For performance reasons mod_magnet caches the compiled script. For each script-run the script itself is checked for
+freshness and recompile if neccesary.
+
+
+Installation
+============
+
+mod_magnet needs a lighty which is compiled with the lua-support ( --with-lua). Lua 5.1 or higher are required by
+the module. Use "--with-lua=lua5.1" to install on Debian and friends. ::
+
+ server.modules = ( ..., "mod_magnet", ... )
+
+Options
+=======
+
+mod_magnet can attract a request in several stages in the request-handling.
+
+* either at the same level as mod_rewrite, before any parsing of the URL is done
+* or at a later stage, when the doc-root is known and the physical-path is already setup
+
+It depends on the purpose of the script which stage you want to intercept. Usually you want to use
+the 2nd stage where the physical-path which relates to your request is known. At this level you
+can run checks against lighty.env["physical.path"].
+
+::
+
+ magnet.attract-raw-url-to = ( ... )
+ magnet.attract-physical-path-to = ( ... )
+
+You can define multiple scripts when separated by a semicolon. The scripts are executed in the specified
+order. If one of them a returning a status-code, the following scripts will not be executed.
+
+Tables
+======
+
+Most of the interaction between between mod_magnet and lighty is done through tables. Tables in lua are hashes (Perl), dictionaries (Java), arrays (PHP), ...
+
+Request-Environment
+-------------------
+
+Lighttpd has its internal variables which are exported as read/write to the magnet.
+
+If "http://example.org/search.php?q=lighty" is requested this results in a request like ::
+
+ GET /search.php?q=lighty HTTP/1.1
+ Host: example.org
+
+When you are using ``attract-raw-url-to`` you can access the following variables:
+
+* parts of the request-line
+
+ * lighty.env["request.uri"] = "/search.php?q=lighty"
+
+* HTTP request-headers
+
+ * lighty.request["Host"] = "example.org"
+
+Later in the request-handling, the URL is splitted, cleaned up and turned into a physical path name:
+
+* parts of the URI
+
+ * lighty.env["uri.path"] = "/search.php"
+ * lighty.env["uri.path-raw"] = "/search.php"
+ * lighty.env["uri.scheme"] = "http"
+ * lighty.env["uri.authority"] = "example.org"
+ * lighty.env["uri.query"] = "q=lighty"
+
+* filenames, pathnames
+
+ * lighty.env["physical.path"] = "/my-docroot/search.php"
+ * lighty.env["physical.rel-path"] = "/search.php"
+ * lighty.env["physical.doc-root"] = "/my-docroot"
+
+All of them are readable, not all of the are writable (or don't have an effect if you write to them).
+
+As a start, you might want to use those variables for writing: ::
+
+ -- 1. simple rewriting is done via the request.uri
+ lighty.env["request.uri"] = ...
+ return lighty.RESTART_REQUEST
+
+ -- 2. changing the physical-path
+ lighty.env["physical.path"] = ...
+
+ -- 3. changing the query-string
+ lighty.env["uri.query"] = ...
+
+Response Headers
+----------------
+
+If you want to set a response header for your request, you can add a field to the lighty.header[] table: ::
+
+ lighty.header["Content-Type"] = "text/html"
+
+Sending Content
+===============
+
+You can generate your own content and send it out to the clients. ::
+
+ lighty.content = { "<pre>", { filename = "/etc/passwd" }, "</pre>" }
+ lighty.header["Content-Type"] = "text/html"
+
+ return 200
+
+The lighty.content[] table is executed when the script is finished. The elements of the array are processed left to right and the elements can either be a string or a table. Strings are included AS IS into the output of the request.
+
+* Strings
+
+ * are included as is
+
+* Tables
+
+ * filename = "<absolute-path>" is required
+ * offset = <number> [default: 0]
+ * length = <number> [default: size of the file - offset]
+
+Internally lighty will use the sendfile() call to send out the static files at full speed.
+
+Status Codes
+============
+
+You might have seen it already in other examples: In case you are handling the request completly in the magnet you
+can return your own status-codes. Examples are: Redirected, Input Validation, ... ::
+
+ if (lighty.env["uri.scheme"] == "http") then
+ lighty.header["Location"] = "https://" .. lighty.env["uri.authority"] .. lighty.env["request.uri"]
+ return 302
+ end
+
+You every number above and equal to 100 is taken as final status code and finishes the request. No other modules are
+executed after this return.
+
+A special return-code is lighty.RESTART_REQUEST (currently equal to 99) which is usually used in combination with
+changing the request.uri in a rewrite. It restarts the splitting of the request-uri again.
+
+If you return nothing (or nil) the request-handling just continues.
+
+Debugging
+=========
+
+To easy debugging we overloaded the print()-function in lua and redirect the output of print() to the error-log. ::
+
+ print("Host: " .. lighty.request["Host"])
+ print("Request-URI: " .. lighty.env["request.uri"])
+
+
+Examples
+========
+
+Sending text-files as HTML
+--------------------------
+
+This is a bit simplistic, but it illustrates the idea: Take a text-file and cover it in a <pre> tag.
+
+Config-file ::
+
+ magnet.attract-physical-path-to = server.docroot + "/readme.lua"
+
+readme.lua ::
+
+ lighty.content = { "<pre>", { filename = "/README" }, "</pre>" }
+ lighty.header["Content-Type"] = "text/html"
+
+ return 200
+
+Maintainance pages
+------------------
+
+Your side might be on maintainance from time to time. Instead of shutting down the server confusing all
+users, you can just send a maintainance page.
+
+Config-file ::
+
+ magnet.attract-physical-path-to = server.docroot + "/maintainance.lua"
+
+maintainance.lua ::
+
+ require "lfs"
+
+ if (nil == lfs.attributes(lighty.env["physical.doc-root"] .. "/maintainance.html")) then
+ lighty.content = ( lighty.env["physical.doc-root"] .. "/maintainance.html" )
+
+ lighty.header["Content-Type"] = "text/html"
+
+ return 200
+ end
+
+mod_flv_streaming
+-----------------
+
+Config-file ::
+
+ magnet.attract-physical-path-to = server.docroot + "/flv-streaming.lua"
+
+flv-streaming.lua::
+
+ if (lighty.env["uri.query"]) then
+ -- split the query-string
+ get = {}
+ for k, v in string.gmatch(lighty.env["uri.query"], "(%w+)=(%w+)") do
+ get[k] = v
+ end
+
+ if (get["start"]) then
+ -- missing: check if start is numeric and positive
+
+ -- send te FLV header + a seek into the file
+ lighty.content = { "FLV\x1\x1\0\0\0\x9\0\0\0\x9",
+ { filename = lighty.env["physical.path"], offset = get["start"] } }
+ lighty.header["Content-Type"] = "video/x-flv"
+
+ return 200
+ end
+ end
+
+
+selecting a random file from a directory
+----------------------------------------
+
+Say, you want to send a random file (ad-content) from a directory.
+
+To simplify the code and to improve the performance we define:
+
+* all images have the same format (e.g. image/png)
+* all images use increasing numbers starting from 1
+* a special index-file names the highest number
+
+Config ::
+
+ server.modules += ( "mod_magnet" )
+ magnet.attract-physical-path-to = "random.lua"
+
+random.lua ::
+
+ dir = lighty.env["physical.path"]
+
+ f = assert(io.open(dir .. "/index", "r"))
+ maxndx = f:read("*all")
+ f:close()
+
+ ndx = math.random(maxndx)
+
+ lighty.content = { { filename = dir .. "/" .. ndx }}
+ lighty.header["Content-Type"] = "image/png"
+
+ return 200
+
+denying illegal character sequences in the URL
+----------------------------------------------
+
+Instead of implementing mod_security, you might just want to apply filters on the content
+and deny special sequences that look like SQL injection.
+
+A common injection is using UNION to extend a query with another SELECT query.
+
+::
+
+ if (string.find(lighty.env["request.uri"], "UNION%s")) then
+ return 400
+ end
+
+Traffic Quotas
+--------------
+
+If you only allow your virtual hosts a certain amount for traffic each month and want to
+disable them if the traffic is reached, perhaps this helps: ::
+
+ host_blacklist = { ["www.example.org"] = 0 }
+
+ if (host_blacklist[lighty.request["Host"]]) then
+ return 404
+ end
+
+Just add the hosts you want to blacklist into the blacklist table in the shown way.
+
+Complex rewrites
+----------------
+
+If you want to implement caching on your document-root and only want to regenerate
+content if the requested file doesn't exist, you can attract the physical.path: ::
+
+ magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" )
+
+rewrite.lua ::
+
+ require "lfs"
+
+ attr = lfs.attributes(lighty.env["physical.path"])
+
+ if (not attr) then
+ -- we couldn't stat() the file for some reason
+ -- let the backend generate it
+
+ lighty.env["uri.path"] = "/dispatch.fcgi"
+ lighty.env["physical.rel-path"] = lighty.env["uri.path"]
+ lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]
+ fi
+
+luafilesystem
++++++++++++++
+
+We are requiring the lua-module 'lfs' (http://www.keplerproject.org/luafilesystem/).
+
+I had to compile lfs myself for lua-5.1 which required a minor patch as compat-5.1 is not needed::
+
+ $ wget http://luaforge.net/frs/download.php/1487/luafilesystem-1.2.tar.gz
+ $ wget http://www.lighttpd.net/download/luafilesystem-1.2-lua51.diff
+ $ gzip -cd luafilesystem-1.2.tar.gz | tar xf -
+ $ cd luafilesystem-1.2
+ $ patch -ls -p1 < ../luafilesystem-1.2-lua51.diff
+ $ make install
+
+It will install lfs.so into /usr/lib/lua/5.1/ which is where lua expects the extensions on my system.
+
+SuSE and Gentoo are known to have their own lfs packages and don't require a compile.
+
+Usertracking
+------------
+
+... or how to store data globally in the script-context:
+
+Each script has its own script-context. When the script is started it only contains the lua-functions
+and the special lighty.* name-space. If you want to save data between script runs, you can use the global-script
+context:
+
+::
+
+ if (nil == _G["usertrack"]) then
+ _G["usertrack"] = {}
+ end
+ if (nil == _G["usertrack"][lighty.request["Cookie"]]) then
+ _G["usertrack"][lighty.request["Cookie"]]
+ else
+ _G["usertrack"][lighty.request["Cookie"]] = _G["usertrack"][lighty.request["Cookie"]] + 1
+ end
+
+ print _G["usertrack"][lighty.request["Cookie"]]
+
+The global-context is per script. If you update the script without restarting the server, the context will still be maintained.
+
+Counters
+--------
+
+mod_status support a global statistics page and mod_magnet allows to add and update values in the status page:
+
+Config ::
+
+ status.statistics-url = "/server-counters"
+ magnet.attract-raw-url-to = server.docroot + "/counter.lua"
+
+counter.lua ::
+
+ lighty.status["core.connections"] = lighty.status["core.connections"] + 1
+
+Result::
+
+ core.connections: 7
+ fastcgi.backend.php-foo.0.connected: 0
+ fastcgi.backend.php-foo.0.died: 0
+ fastcgi.backend.php-foo.0.disabled: 0
+ fastcgi.backend.php-foo.0.load: 0
+ fastcgi.backend.php-foo.0.overloaded: 0
+ fastcgi.backend.php-foo.1.connected: 0
+ fastcgi.backend.php-foo.1.died: 0
+ fastcgi.backend.php-foo.1.disabled: 0
+ fastcgi.backend.php-foo.1.load: 0
+ fastcgi.backend.php-foo.1.overloaded: 0
+ fastcgi.backend.php-foo.load: 0
+
+Porting mod_cml scripts
+-----------------------
+
+mod_cml got replaced by mod_magnet.
+
+A CACHE_HIT in mod_cml::
+
+ output_include = { "file1", "file2" }
+
+ return CACHE_HIT
+
+becomes::
+
+ content = { { filename = "/path/to/file1" }, { filename = "/path/to/file2"} }
+
+ return 200
+
+while a CACHE_MISS like (CML) ::
+
+ trigger_handler = "/index.php"
+
+ return CACHE_MISS
+
+becomes (magnet) ::
+
+ lighty.env["request.uri"] = "/index.php"
+
+ return lighty.RESTART_REQUEST
+
+}}}
\ No newline at end of file
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/mysqlvhost.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/mysqlvhost.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/mysqlvhost.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/mysqlvhost.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,58 @@
+====================
+MySQL-based vhosting
+====================
+
+-----------------------
+Module: mod_mysql_vhost
+-----------------------
+
+:Author: ada@riksnet.se
+:Date: $Date: 2004/08/29 09:43:49 $
+:Revision: $Revision: 1.1 $
+
+:abstract:
+ This module provides virtual hosts (vhosts) based on a MySQL table
+
+.. meta::
+ :keywords: lighttpd, mysql, vhost
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+With MySQL-based vhosting you can store the path to a given host's
+document root in a MySQL database.
+
+.. note:: Keep in mind that only one vhost module should be active at a time.
+ Don't mix mod_simple_vhost with mod_mysql_vhost.
+
+Options
+=======
+
+Example: ::
+
+ mysql-vhost.db = "lighttpd"
+ mysql-vhost.user = "lighttpd"
+ mysql-vhost.pass = "secret"
+ mysql-vhost.sock = "/var/mysql.lighttpd.sock"
+ mysql-vhost.sql = "SELECT docroot FROM domains WHERE domain='?'"
+
+
+MySQL setup: ::
+
+ GRANT SELECT ON lighttpd.* TO lighttpd@localhost IDENTIFIED BY 'secret';
+
+ CREATE DATABASE lighttpd;
+
+ USE lighttpd;
+
+ CREATE TABLE domains (
+ domain varchar(64) not null primary key,
+ docroot varchar(128) not null
+ );
+
+ INSERT INTO domains VALUES ('host.dom.ain','/http/host.dom.ain/');
+
+
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/newstyle.css
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/newstyle.css?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/newstyle.css (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/newstyle.css Mon Jul 21 21:35:35 2008
@@ -0,0 +1,49 @@
+body {
+ background-color: #F5F5F5;
+}
+a, a:active {
+ text-decoration: none;
+ color: blue;
+}
+a:visited {
+ color: #48468F;
+}
+a:hover, a:focus {
+ text-decoration: underline;
+ color: red;
+}
+h2 {
+ margin-bottom: 12px;
+}
+table {
+ margin-left: 12px;
+}
+th, td {
+ font-family: "Courier New", Courier, monospace;
+ font-size: 10pt;
+ text-align: left;
+}
+th {
+ font-weight: bold;
+ padding-right: 14px;
+ padding-bottom: 3px;
+}
+td {
+ padding-right: 14px;
+}
+td.s, th.s {
+ text-align: right;
+}
+div.list {
+ background-color: white;
+ border-top: 1px solid #646464;
+ border-bottom: 1px solid #646464;
+ padding-top: 10px;
+ padding-bottom: 14px;
+}
+div.foot {
+ font-family: "Courier New", Courier, monospace;
+ font-size: 10pt;
+ color: #787878;
+ padding-top: 4px;
+}
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/oldstyle.css
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/oldstyle.css?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/oldstyle.css (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/oldstyle.css Mon Jul 21 21:35:35 2008
@@ -0,0 +1,25 @@
+table {
+ border: 1px solid black;
+ padding: 1px;
+}
+th {
+ background-color: black;
+ border: 1px solid white;
+ color: white;
+ padding-right: 2px;
+ padding-left: 2px;
+}
+td {
+ background-color: #f0f0f0;
+ border: 1px solid white;
+ padding-right: 2px;
+ padding-left: 2px;
+}
+td.s {
+ background-color: #f0f0f0;
+ text-align: right;
+ padding-left: 14px;
+}
+div.foot {
+ margin-top: 4px;
+}
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/performance.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/performance.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/performance.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/performance.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,239 @@
+========================
+Performance Improvements
+========================
+
+------------
+Module: core
+------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/11/03 22:26:05 $
+:Revision: $Revision: 1.3 $
+
+:abstract:
+ handling performance issues in lighttpd
+
+.. meta::
+ :keywords: lighttpd, performance
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+Performance Issues
+------------------
+
+lighttpd is optimized into varying directions. The most important direction is
+performance. The operation system has two major facilities to help lighttpd
+a deliver its best performance.
+
+HTTP Keep-Alive
+---------------
+
+Disabling keep-alive might help your server if you suffer from a large
+number of open file descriptors.
+
+The defaults for the server are: ::
+
+ server.max-keep-alive-requests = 128
+ server.max-keep-alive-idle = 30
+ server.max-read-idle = 60
+ server.max-write-idle = 360
+
+handling 128 keep-alive requests in a row on a single connection, waiting 30 seconds
+before an unused keep-alive connection gets dropped by lighttpd.
+
+If you handle several connections at once under a high load (let's assume 500 connections
+in parallel for 24h) you might run into the out-of-fd problem described below. ::
+
+ server.max-keep-alive-requests = 4
+ server.max-keep-alive-idle = 4
+
+would release the connections earlier and would free file descriptors without a
+detrimental performance loss.
+
+Disabling keep-alive completely is the last resort if you are still short on file descriptors: ::
+
+ server.max-keep-alive-requests = 0
+
+Event Handlers
+--------------
+
+The first one is the Event Handler which takes care of notifying the server
+that one of the connections is ready to send or receive. As you can see,
+every OS has at least the select() call which has some limitations.
+
+============ ========== ===============
+OS Method Config Value
+============ ========== ===============
+all select select
+Unix poll poll
+Linux 2.4+ rt-signals linux-rtsig
+Linux 2.6+ epoll linux-sysepoll
+Solaris /dev/poll solaris-devpoll
+FreeBSD, ... kqueue freebsd-kqueue
+============ ========== ===============
+
+
+For more information on this topic take a look at http://www.kegel.com/c10k.html
+
+Configuration
+`````````````
+
+The event handler can be set by specifying the 'Config Value' from above
+in the ``server.event-handler`` variable
+
+e.g.: ::
+
+ server.event-handler = "linux-sysepoll"
+
+Network Handlers
+----------------
+
+The basic network interface for all platforms at the syscalls read() and
+write(). Every modern OS provides its own syscall to help network servers
+transfer files as fast as possible.
+
+If you want to send out a file from the webserver, it doesn't make any sense
+to copy the file into the webserver just to write() it back into a socket
+in the next step.
+
+sendfile() minimizes the work in the application and pushes a file directly
+into the network card (ideally).
+
+lighttpd supports all major platform-specific calls:
+
+========== ==========
+OS Method
+========== ==========
+all write
+Unix writev
+Linux 2.4+ sendfile
+Linux 2.6+ sendfile64
+Solaris sendfilev
+FreeBSD sendfile
+========== ==========
+
+The best backend is selected at compile time. In case you want to use
+another backend set: ::
+
+ server.network-backend = "writev"
+
+You can find more information about network backend in:
+
+ http://blog.lighttpd.net/articles/2005/11/11/optimizing-lighty-for-high-concurrent-large-file-downloads
+
+
+Max Connections
+---------------
+
+As lighttpd is a single-threaded server, its main resource limit is the
+number of file descriptors, which is set to 1024 by default (on most systems).
+
+If you are running a high-traffic site you might want to increase this limit
+by setting ::
+
+ server.max-fds = 2048
+
+This only works if lighttpd is started as root.
+
+Out-of-fd condition
+-------------------
+
+Since file descriptors are used for TCP/IP sockets, files and directories,
+a simple request for a PHP page might result in using 3 file descriptors:
+
+1. the TCP/IP socket to the client
+2. the TCP/IP and Unix domain socket to the FastCGI process
+3. the filehandle to the file in the document root to check if it exists
+
+If lighttpd runs out of file descriptors, it will stop accepting new
+connections for awhile to use the existing file descriptors to handle the
+currently-running requests.
+
+If more than 90% of the file descriptors are used then the handling of new
+connections is disabled. If it drops below 80% again new connections will
+be accepted again.
+
+Under some circumstances you will see ::
+
+ ... accept() failed: Too many open files
+
+in the error log. This tells you there were too many new requests at once
+and lighttpd could not disable the incoming connections soon enough. The
+connection was dropped and the client received an error message like 'connection
+failed'. This is very rare and might only occur in test setups.
+
+Increasing the ``server.max-fds`` limit will reduce the probability of this
+problem.
+
+stat() cache
+============
+
+A stat(2) can be expensive; caching it saves time and context switches.
+
+Instead of using stat() every time to check for the existence of a file
+you can stat() it once and monitor the directory the file is in for
+modifications. As long as the directory doesn't change, the files in it
+must all still be the same.
+
+With the help of FAM or gamin you can use kernel events to assure that
+your stat cache is up to date. ::
+
+ server.stat-cache-engine = "fam" # either fam, simple or disabled
+
+
+Platform-Specific Notes
+=======================
+
+Linux
+-----
+
+For Linux 2.4.x you should think about compiling lighttpd with the option
+``--disable-lfs`` to disable the support for files larger than 2GB. lighttpd will
+fall back to the ``writev() + mmap()`` network calls which is ok, but not as
+fast as possible but support files larger than 2GB.
+
+Disabling the TCP options reduces the overhead of each TCP packet and might
+help to get the last few percent of performance out of the server. Be aware that
+disabling these options most likely decreases performance for high-latency and lossy
+links.
+
+- net.ipv4.tcp_sack = 0
+- net.ipv4.tcp_timestamps = 0
+
+Increasing the TCP send and receive buffers will increase the performance a
+lot if (and only if) you have a lot of large files to send.
+
+- net.ipv4.tcp_wmem = 4096 65536 524288
+- net.core.wmem_max = 1048576
+
+If you have a lot of large file uploads, increasing the receive buffers will help.
+
+- net.ipv4.tcp_rmem = 4096 87380 524288
+- net.core.rmem_max = 1048576
+
+Keep in mind that every TCP connection uses the configured amount of memory for socket
+buffers. If you've got many connections this can quickly drain the available memory.
+
+See http://www.acc.umu.se/~maswan/linux-netperf.txt for more information on these parameters.
+
+FreeBSD
+-------
+
+On FreeBSD you might gain some performance by enabling accept filters. Just
+compile your kernel with: ::
+
+ options ACCEPT_FILTER_HTTP
+
+For more ideas about tuning FreeBSD read: tuning(7)
+
+Reducing the recvspace should always be ok if the server only handles HTTP
+requests without large uploads. Increasing the sendspace would reduce the
+system load if you have a lot of large files to be sent, but keep in mind that
+you have to provide the memory in the kernel for each connection. 1024 * 64KB
+would mean 64MB of kernel RAM. Keep this in mind.
+
+- net.inet.tcp.recvspace = 4096
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/plugins.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/plugins.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/plugins.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/plugins.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,260 @@
+================
+Plugin Interface
+================
+
+------------
+Module: core
+------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/08/01 07:01:29 $
+:Revision: $Revision: 1.1 $
+
+:abstract:
+ The plugin interface is an integral part of lighttpd which
+ provides a flexible way to add specific functionality to lighttpd.
+
+.. meta::
+ :keywords: lighttpd, plugins
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+Plugins allow you to enhance the functionality of lighttpd without
+changing the core of the webserver. They can be loaded at startup time
+and can change virtually any aspect of the behaviour of the webserver.
+
+Plugin Entry Points
+-------------------
+
+lighttpd has 16 hooks which are used in different states of the
+execution of the request:
+
+Serverwide hooks
+````````````````
+
+:init_:
+ called when the plugin is loaded
+:cleanup_:
+ called when the plugin is unloaded
+:set_defaults_:
+ called when the configuration has to be processed
+:handle_trigger_:
+ called once a second
+:handle_sighup_:
+ called when the server received a SIGHUP
+
+Connectionwide hooks
+````````````````````
+
+Most of these hooks are called in ``http_response_prepare()`` after some
+fields in the connection structure are set.
+
+:handle_uri_raw_:
+ called after uri.path_raw, uri.authority and uri.scheme are set
+:handle_uri_clean_:
+ called after uri.path (a clean URI without .. and %20) is set
+:handle_docroot_:
+ called at the end of the logical path handle to get a docroot
+:handle_subrequest_start_:
+ called if the physical path is set up and checked
+:handle_subrequest_:
+ called at the end of ``http_response_prepare()``
+:handle_physical_path_:
+ called after the physical path is created and no other handler is
+ found for this request
+:handle_request_done_:
+ called when the request is done
+:handle_connection_close_:
+ called if the connection has to be closed
+:handle_joblist_:
+ called after the connection_state_engine is left again and plugin
+ internal handles have to be called
+:connection_reset_:
+ called if the connection structure has to be cleaned up
+
+
+Plugin Interface
+----------------
+
+\*_plugin_init
+``````````````
+
+Every plugin has a uniquely-named function which is called after the
+plugin is loaded. It is used to set up the ``plugin`` structure with
+some useful data:
+
+- name of the plugin ``name``
+- all hooks
+
+The field ``data`` and ``lib`` should not be touched in the init function.
+``lib`` is the library handler from dlopen and ``data`` will be the storage
+of the internal plugin data.
+
+:returns:
+ 0 (not handled)
+
+init
+````
+
+The first real call of a plugin function is the init hook which is used
+to set up the internal plugin data. The internal plugin is assigned the
+``data`` field mentioned in the \*_plugin_init description.
+
+:returns:
+ a pointer to the internal plugin data.
+
+cleanup
+```````
+
+The cleanup hook is called just before the plugin is unloaded. It is meant
+to free all buffers allocated in ``init`` or somewhere else in the plugin
+which are still not freed and to close all handles which were opened and
+are not closed yet.
+
+:returns:
+ HANDLER_GO_ON if ok (not handled)
+
+set_defaults
+````````````
+
+set_defaults is your entry point into the configfile parsing. It should
+pass a list of options to ``config_insert_values`` and check if
+the plugin configuration is valid. If it is not valid yet, it should
+set useful defaults or return with HANDLER_ERROR and an error message.
+
+:returns:
+ HANDLER_GO_ON if ok
+
+ HANDLER_ERROR will terminate lighttpd
+
+connection_reset
+````````````````
+
+called at the end of each request
+
+:returns:
+ HANDLER_GO_ON if ok
+
+ HANDLER_ERROR on error
+
+handle_trigger
+``````````````
+
+called once a second
+
+:returns:
+ HANDLER_GO_ON if ok
+
+ HANDLER_ERROR on error
+
+handle_sighup
+`````````````
+
+called if a SIGHUP is received (cycling logfiles, ...)
+
+:returns:
+ HANDLER_GO_ON if ok
+
+ HANDLER_ERROR on error
+
+handle_uri_raw
+``````````````
+
+called after uri_raw is set
+
+:returns:
+ HANDLER_GO_ON if ok
+ HANDLER_FINISHED if the final output is prepared
+
+ HANDLER_ERROR on error
+
+handle_uri_clean
+````````````````
+
+called after uri.path is set
+
+:returns:
+ HANDLER_GO_ON if ok
+ HANDLER_FINISHED if the final output is prepared
+
+ HANDLER_ERROR on error
+
+handle_docroot
+``````````````
+
+called when a docroot is needed
+
+:returns:
+ HANDLER_GO_ON if ok
+ HANDLER_FINISHED if the final output is prepared
+
+ HANDLER_ERROR on error
+
+handle_subrequest_start
+```````````````````````
+
+called after physical.path is set
+
+:returns:
+ HANDLER_GO_ON if ok
+ HANDLER_FINISHED if the final output is prepared
+
+ HANDLER_ERROR on error
+
+handle_subrequest
+`````````````````
+
+called if subrequest_start requested a COMEBACK or a WAIT_FOR_EVENT
+
+:returns:
+ HANDLER_GO_ON if ok
+ HANDLER_FINISHED if the final output is prepared
+
+ HANDLER_ERROR on error
+
+handle_physical_path
+````````````````````
+
+called after physical.path is set
+
+:returns:
+ HANDLER_GO_ON if ok
+ HANDLER_FINISHED if the final output is prepared
+
+ HANDLER_ERROR on error
+
+
+handle_request_done
+```````````````````
+
+called at the end of the request (logging, statistics, ...)
+
+:returns:
+ HANDLER_GO_ON if ok
+
+ HANDLER_ERROR on error
+
+handle_connection_close
+```````````````````````
+
+called if the connection is terminated
+
+:returns:
+ HANDLER_GO_ON if ok
+
+ HANDLER_ERROR on error
+
+handle_joblist
+``````````````
+
+called if the state of the connection has changed
+
+:returns:
+ HANDLER_GO_ON if ok
+
+ HANDLER_ERROR on error
+
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/proxy.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/proxy.txt?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/proxy.txt (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/proxy.txt Mon Jul 21 21:35:35 2008
@@ -0,0 +1,104 @@
+===================
+the Proxy Interface
+===================
+
+-----------------
+Module: mod_proxy
+-----------------
+
+:Author: Jan Kneschke
+:Date: $Date: 2004/08/01 07:01:29 $
+:Revision: $Revision: 1.1 $
+
+:abstract:
+ The proxy module a simplest way to connect lighttpd to
+ java servers which have a HTTP-interface.
+
+.. meta::
+ :keywords: lighttpd, Proxy
+
+.. contents:: Table of Contents
+
+Description
+===========
+
+...
+
+Options
+=======
+
+lighttpd provides the Proxy support via the proxy-module
+(mod_proxy) which provides 2 options in the config-file:
+
+:proxy.debug:
+ a value between 0 and 65535 to set the debug-level in the
+ Proxy module. Currently only 0 and 1 are used. Use 1 to
+ enable some debug output, 0 to disable it.
+
+:proxy.balance:
+ might be one of 'hash', 'round-robin' or 'fair' (default).
+
+ 'round-robin' choses another host for each request, 'hash'
+ is generating a hash over the request-uri and makes sure
+ that the same request URI is sent to always the same host.
+ That can increase the performance of the backend servers
+ a lot due to higher cache-locality. 'fair' is the normal
+ load-based, passive balancing.
+
+:proxy.server:
+ tell the module where to send Proxy requests to. Every
+ file-extension can have its own handler. Load-Balancing is
+ done by specifying multiple handles for the same extension.
+
+ structure of proxy.server section: ::
+
+ ( <extension> =>
+ (
+ ( "host" => <string> ,
+ "port" => <integer> ),
+ ( "host" => <string> ,
+ "port" => <integer> )
+ ),
+ <extension> => ...
+ )
+
+ :<extension>: is the file-extension or prefix (if started with "/")
+ might empty to match all requests
+ :"host": is ip of the proxy server
+ :"port": is tcp-port on the "host" used by the proxy
+ server (default: 80)
+
+ e.g.: ::
+
+ proxy.server = ( ".jsp" =>
+ ( (
+ "host" => "10.0.0.242",
+ "port" => 81
+ ) )
+ )
+
+Example:
+========
+
+Using lighttpd + mod_proxy in front of 8 Squids which handle the
+caching of dynamic content for you. All requests for the host
+www.example.org should be forwarded to the proxy. All proxies
+listen on port 80 for requests. ::
+
+ $HTTP["host"] == "www.example.org" {
+ proxy.balance = "hash"
+ proxy.server = ( "" => ( ( "host" => "10.0.0.10" ),
+ ( "host" => "10.0.0.11" ),
+ ( "host" => "10.0.0.12" ),
+ ( "host" => "10.0.0.13" ),
+ ( "host" => "10.0.0.14" ),
+ ( "host" => "10.0.0.15" ),
+ ( "host" => "10.0.0.16" ),
+ ( "host" => "10.0.0.17" ) ) )
+ }
+
+If one of the hosts goes down the all requests for this one server are
+moved equally to the other servers. If you want to know more about
+the algorithm used here google for 'Microsoft CARP'.
+
+
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd Mon Jul 21 21:35:35 2008
@@ -0,0 +1,155 @@
+#! /bin/sh
+# Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany.
+# All rights reserved.
+#
+# Author: Kurt Garloff <fe...@suse.de>
+#
+# /etc/init.d/FOO
+#
+# and symbolic its link
+#
+# /(usr/)sbin/rcFOO
+#
+# LSB compliant service control script; see http://www.linuxbase.org/spec/
+#
+# System startup script for some example service or daemon FOO (template)
+#
+### BEGIN INIT INFO
+# Provides: FOO
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Description: Start FOO to allow XY and provide YZ
+# continued on second line by '#<TAB>'
+### END INIT INFO
+#
+# Note on Required-Start: It does specify the init script ordering,
+# not real dependencies. Depencies have to be handled by admin
+# resp. the configuration tools (s)he uses.
+
+# Source SuSE config (if still necessary, most info has been moved)
+test -r /etc/rc.config && . /etc/rc.config
+
+# Check for missing binaries (stale symlinks should not happen)
+LIGHTTPD_BIN=/usr/sbin/lighttpd
+test -x $LIGHTTPD_BIN || exit 5
+
+# Check for existence of needed config file and read it
+LIGHTTPD_CONFIG=/etc/sysconfig/lighttpd
+test -r $LIGHTTPD_CONFIG || exit 6
+. $LIGHTTPD_CONFIG
+
+# Shell functions sourced from /etc/rc.status:
+# rc_check check and set local and overall rc status
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_failed <num> set local and overall rc status to <num><num>
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+# rc_active checks whether a service is activated by symlinks
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0 - success
+# 1 - generic or unspecified error
+# 2 - invalid or excess argument(s)
+# 3 - unimplemented feature (e.g. "reload")
+# 4 - insufficient privilege
+# 5 - program is not installed
+# 6 - program is not configured
+# 7 - program is not running
+#
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signalling is not supported) are
+# considered a success.
+
+case "$1" in
+ start)
+ echo -n "Starting lighttpd"
+ ## Start daemon with startproc(8). If this fails
+ ## the echo return value is set appropriate.
+
+ # NOTE: startproc returns 0, even if service is
+ # already running to match LSB spec.
+ startproc $LIGHTTPD_BIN -f $LIGHTTPD_CONF_PATH
+
+ # Remember status and be verbose
+ rc_status -v
+ ;;
+ stop)
+ echo -n "Shutting down lighttpd"
+ ## Stop daemon with killproc(8) and if this fails
+ ## set echo the echo return value.
+
+ killproc -TERM $LIGHTTPD_BIN
+
+ # Remember status and be verbose
+ rc_status -v
+ ;;
+ try-restart)
+ ## Stop the service and if this succeeds (i.e. the
+ ## service was running before), start it again.
+ ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
+ $0 status >/dev/null && $0 restart
+
+ # Remember status and be quiet
+ rc_status
+ ;;
+ restart)
+ ## Stop the service and regardless of whether it was
+ ## running or not, start it again.
+ $0 stop
+ $0 start
+
+ # Remember status and be quiet
+ rc_status
+ ;;
+ force-reload|reload)
+ ## Like force-reload, but if daemon does not support
+ ## signalling, do nothing (!)
+
+ # If it supports signalling:
+ echo -n "Reload service LIGHTTPD"
+ killproc -INT $LIGHTTPD_BIN
+ $0 start
+ touch /var/run/lighttpd.pid
+ rc_status -v
+
+ ## Otherwise if it does not support reload:
+ #rc_failed 3
+ #rc_status -v
+ ;;
+ status)
+ echo -n "Checking for service LIGHTTPD: "
+ ## Check status with checkproc(8), if process is running
+ ## checkproc will return with exit status 0.
+
+ # Return value is slightly different for the status command:
+ # 0 - service running
+ # 1 - service dead, but /var/run/ pid file exists
+ # 2 - service dead, but /var/lock/ lock file exists
+ # 3 - service not running
+
+ # NOTE: checkproc returns LSB compliant status values.
+ checkproc $LIGHTTPD_BIN
+ rc_status -v
+ ;;
+ probe)
+ ## Optional: Probe for the necessity of a reload,
+ ## print out the argument which is required for a reload.
+
+ test /etc/lighttpd/lighttpd.conf -nt /var/run/lighttpd.pid && echo reload
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
+ exit 1
+ ;;
+esac
+rc_exit
Propchange: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd
------------------------------------------------------------------------------
svn:executable = *
Added: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd.redhat
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd.redhat?rev=678637&view=auto
==============================================================================
--- webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd.redhat (added)
+++ webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd.redhat Mon Jul 21 21:35:35 2008
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# lighttpd Startup script for the lighttpd server
+#
+# chkconfig: - 85 15
+# description: Lightning fast webserver with light system requirements
+#
+# processname: lighttpd
+# config: /etc/lighttpd/lighttpd.conf
+# config: /etc/sysconfig/lighttpd
+# pidfile: /var/run/lighttpd.pid
+#
+# Note: pidfile is assumed to be created
+# by lighttpd (config: server.pid-file).
+# If not, uncomment 'pidof' line.
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+if [ -f /etc/sysconfig/lighttpd ]; then
+ . /etc/sysconfig/lighttpd
+fi
+
+if [ -z "$LIGHTTPD_CONF_PATH" ]; then
+ LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
+fi
+
+prog="lighttpd"
+lighttpd="/usr/sbin/lighttpd"
+RETVAL=0
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon $lighttpd -f $LIGHTTPD_CONF_PATH
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc $lighttpd
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+ return $RETVAL
+}
+
+reload() {
+ echo -n $"Reloading $prog: "
+ killproc $lighttpd -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$prog ]; then
+ stop
+ start
+ fi
+ ;;
+ reload)
+ reload
+ ;;
+ status)
+ status $lighttpd
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
+ RETVAL=1
+esac
+
+exit $RETVAL
Propchange: webservices/axis2/branches/c/lighttpd_mod_axis2/lighttpd/doc/rc.lighttpd.redhat
------------------------------------------------------------------------------
svn:executable = *