Using the lighttpd handler (experimental)

In the /lighttpd directory of the uWSGI distribution you will find the uwsgi handler for the lighttpd webserver.

This is an experimental handler (only few real tests on it) but that should work without particular problems.

First of all download the source of lighttpd and uncompress it.

Copy the lighttpd/mod_uwsgi.c file from the uWSGI distribution to the /src directory of lighttpd.

Add this lines to the src/Makefile.am file of lighttpd (put them after the accesslog block):

lib_LTLIBRARIES += mod_uwsgi.la
mod_uwsgi_la_SOURCES = mod_uwsgi.c
mod_uwsgi_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_uwsgi_la_LIBADD = $(common_libadd)

Now launch:

autoreconf -fi

and as always:

./configure; make; make install

Modify your configuration file:

server.modules              = (
                                ...
                                "mod_uwsgi",
                                ...
                               )

...
...

uwsgi.server  = (
                "/pippo" => (( "host" => "192.168.173.15", "port" => 3033 )),
                "/" => (( "host" => "127.0.0.1", "port" => 3031 )),
                 )

If you specify multiple hosts under the same virtual path/uri load balancing will be activated with fair algo