Skip to content
Myr

updated docs on FastCGI deployment with Lighty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by fmw · committed by Armin Ronacher · parent 4228d72 · Browse files · 1 file+27 added−14 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>

Diff stats

1 file+27 added−14 removed

  • other:+27 added−14 removed

1 file+27 added−14 removed

modified:docs/deploying/fastcgi.rst+27 added-14 removed
23 unmodified lines
2425 #!/usr/bin/python26 from flup.server.fcgi import WSGIServer27 from yourapplication import app28 29 if __name__ == '__main__':30 WSGIServer(app).run()3129 WSGIServer(app).run()3031This is enough for Apache to work, however lighttpd and nginx need a32socket to communicate with the FastCGI server. For that to work you33need to pass the path to the socket to the32This is enough for Apache to work, however nginx and older versions of33lighttpd need a socket to be explicitly passed to communicate with the FastCGI34server. For that to work you need to pass the path to the socket to the35:class:`~flup.server.fcgi.WSGIServer`::3637 WSGIServer(application, bindAddress='/path/to/fcgi.sock').run()38
15 unmodified lines
54--------------------5556A basic FastCGI configuration for lighttpd looks like that::5757 fastcgi.server = ("/yourapplication" =>58 "yourapplication" => (58 fastcgi.server = ("/yourapplication.fcgi" =>59 ((60 "socket" => "/tmp/yourapplication-fcgi.sock",61 "bin-path" => "/var/www/yourapplication/yourapplication.fcgi",61 "check-local" => "disable"62 )62 "check-local" => "disable",63 "max-procs" -> 164 ))65 )6665This configuration binds the application to `/yourapplication`. If you66want the application to work in the URL root you have to work around a67lighttpd bug with the :class:`~werkzeug.contrib.fixers.LighttpdCGIRootFix`68middleware.67 alias.url = (68 "/static/" => "/path/to/your/static"69 )7071 url.rewrite-once = (72 "^(/static.*)$" => "$1",73 "^(/.*)$" => "/yourapplication.fcgi$1"7475Remember to enable the FastCGI, alias and rewrite modules. This configuration76binds the application to `/yourapplication`. If you want the application to77work in the URL root you have to work around a lighttpd bug with the78:class:`~werkzeug.contrib.fixers.LighttpdCGIRootFix` middleware.7980Make sure to apply it only if you are mounting the application the URL71root.81root. Also, see the Lighty docs for more information on `FastCGI and Python82<http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_ (note that83explicitly passing a socket to run() is no longer necessary).848586Configuring nginx87-----------------8889Installing FastCGI applications on nginx is a bit different because by default
63 unmodified lines