Browse Source

Touch up fastcgi doc.

pull/496/head
Ron DuPlain 13 years ago
parent
commit
fb01187885
  1. 26
      docs/deploying/fastcgi.rst

26
docs/deploying/fastcgi.rst

@ -54,16 +54,19 @@ can execute it:
Configuring Apache Configuring Apache
------------------ ------------------
The example above is good enough for a basic Apache deployment but your `.fcgi` file will appear in your application URL e.g. www.example.com/yourapplication.fcgi/news/. There are few ways to resolve it. A preferable way is to use Apache ScriptAlias configuration directive:: The example above is good enough for a basic Apache deployment but your `.fcgi`
file will appear in your application URL
e.g. example.com/yourapplication.fcgi/news/. There are few ways to configure
your application so that yourapplication.fcgi does not appear in the URL. A
preferable way is to use the ScriptAlias configuration directive::
<VirtualHost *> <VirtualHost *>
ServerName example.com ServerName example.com
ScriptAlias / /path/to/yourapplication.fcgi/ ScriptAlias / /path/to/yourapplication.fcgi/
</VirtualHost> </VirtualHost>
Another way is to use a custom WSGI middleware. For example on a shared web hosting:: If you cannot set ScriptAlias, for example on an shared web host, you can use
WSGI middleware to remove yourapplication.fcgi from the URLs. Set .htaccess::
.htaccess
<IfModule mod_fcgid.c> <IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi AddHandler fcgid-script .fcgi
@ -81,7 +84,7 @@ Another way is to use a custom WSGI middleware. For example on a shared web host
RewriteRule ^(.*)$ yourapplication.fcgi/$1 [QSA,L] RewriteRule ^(.*)$ yourapplication.fcgi/$1 [QSA,L]
</IfModule> </IfModule>
yourapplication.fcgi Set yourapplication.fcgi::
#!/usr/bin/python #!/usr/bin/python
#: optional path to your local python site-packages folder #: optional path to your local python site-packages folder
@ -128,16 +131,15 @@ A basic FastCGI configuration for lighttpd looks like that::
"^(/static.*)$" => "$1", "^(/static.*)$" => "$1",
"^(/.*)$" => "/yourapplication.fcgi$1" "^(/.*)$" => "/yourapplication.fcgi$1"
Remember to enable the FastCGI, alias and rewrite modules. This Remember to enable the FastCGI, alias and rewrite modules. This configuration
configuration binds the application to `/yourapplication`. If you want binds the application to `/yourapplication`. If you want the application to
the application to work in the URL root you have to work around a work in the URL root you have to work around a lighttpd bug with the
lighttpd bug with the
:class:`~werkzeug.contrib.fixers.LighttpdCGIRootFix` middleware. :class:`~werkzeug.contrib.fixers.LighttpdCGIRootFix` middleware.
Make sure to apply it only if you are mounting the application the URL Make sure to apply it only if you are mounting the application the URL
root. Also, see the Lighty docs for more information on `FastCGI and root. Also, see the Lighty docs for more information on `FastCGI and Python
Python <http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_ <http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_ (note that
(note that explicitly passing a socket to run() is no longer necessary). explicitly passing a socket to run() is no longer necessary).
Configuring nginx Configuring nginx
----------------- -----------------

Loading…
Cancel
Save