-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from gstrauss/master
lighttpd 1.4.42+ mod_scgi supports uwsgi protocol
- Loading branch information
Showing
1 changed file
with
10 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,23 @@ | ||
Lighttpd support | ||
================ | ||
|
||
.. note:: Lighttpd support is experimental. | ||
|
||
The uwsgi handler for Lighttpd lives in the ``/lighttpd`` directory of the | ||
uWSGI distribution. | ||
|
||
Building the module | ||
------------------- | ||
|
||
First download the source of lighttpd and uncompress it. Copy the | ||
``lighttpd/mod_uwsgi.c`` file from the uWSGI distribution into Lighttpd's | ||
``/src`` directory. Add the following to the lighttpd ``src/Makefile.am`` | ||
file, 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) | ||
|
||
Then launch | ||
|
||
:: | ||
|
||
autoreconf -fi | ||
|
||
and as usual, | ||
|
||
:: | ||
|
||
./configure && make && make install | ||
lighttpd >= 1.4.42 supports the uwsgi protocol with Python WSGI backends. | ||
The uwsgi protocol is similar to the SCGI protocol, and lighttpd supports | ||
both protocols in mod_scgi. | ||
|
||
Configuring Lighttpd | ||
-------------------- | ||
|
||
Modify your configuration file: | ||
Modify your lighttpd.conf configuration file: | ||
|
||
:: | ||
server.modules = ( | ||
... | ||
"mod_uwsgi", | ||
... | ||
) | ||
|
||
# ... | ||
|
||
uwsgi.server = ( | ||
"/pippo" => (( "host" => "192.168.173.15", "port" => 3033 )), | ||
server.modules += ( "mod_scgi" ) | ||
scgi.protocol = "uwsgi" | ||
scgi.server = ( | ||
"/" => (( "host" => "127.0.0.1", "port" => 3031 )), | ||
) | ||
|
||
If you specify multiple hosts under the same virtual path/URI, load balancing | ||
will be activated with the "Fair" algorithm. | ||
Further doc on configuring lighttpd and Python WSGI can be found at | ||
https://redmine.lighttpd.net/projects/lighttpd/wiki/HowToPythonWSGI | ||
including examples configuring uWSGI servers. |