Skip to content
Myr

Touch up fastcgi doc.

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

authored by Ron DuPlain · committed by Ron DuPlain · parent 34380b9 · Browse files · 1 file+16 added−14 removed
This commit

State

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

Diff stats

1 file+16 added−14 removed

  • other:+16 added−14 removed

1 file+16 added−14 removed

modified:docs/deploying/fastcgi.rst+16 added-14 removed
52 unmodified lines
5354Configuring Apache55------------------5657The 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::57The example above is good enough for a basic Apache deployment but your `.fcgi`58file will appear in your application URL59e.g. example.com/yourapplication.fcgi/news/. There are few ways to configure60your application so that yourapplication.fcgi does not appear in the URL. A61preferable way is to use the ScriptAlias configuration directive::6263 <VirtualHost *>64 ServerName example.com65 ScriptAlias / /path/to/yourapplication.fcgi/66 </VirtualHost>6764Another way is to use a custom WSGI middleware. For example on a shared web hosting::68If you cannot set ScriptAlias, for example on an shared web host, you can use69WSGI middleware to remove yourapplication.fcgi from the URLs. Set .htaccess::7066 .htaccess6771 <IfModule mod_fcgid.c>72 AddHandler fcgid-script .fcgi73 <Files ~ (\.fcgi)>74 SetHandler fcgid-script
8 unmodified lines
83 RewriteCond %{REQUEST_FILENAME} !-f84 RewriteRule ^(.*)$ yourapplication.fcgi/$1 [QSA,L]85 </IfModule>8684 yourapplication.fcgi87Set yourapplication.fcgi::8889 #!/usr/bin/python90 #: optional path to your local python site-packages folder91 import sys
38 unmodified lines
130 url.rewrite-once = (131 "^(/static.*)$" => "$1",132 "^(/.*)$" => "/yourapplication.fcgi$1"133131Remember to enable the FastCGI, alias and rewrite modules. This132configuration binds the application to `/yourapplication`. If you want133the application to work in the URL root you have to work around a134lighttpd bug with the134Remember to enable the FastCGI, alias and rewrite modules. This configuration135binds the application to `/yourapplication`. If you want the application to136work in the URL root you have to work around a lighttpd bug with the137:class:`~werkzeug.contrib.fixers.LighttpdCGIRootFix` middleware.138139Make sure to apply it only if you are mounting the application the URL138root. Also, see the Lighty docs for more information on `FastCGI and139Python <http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_140(note that explicitly passing a socket to run() is no longer necessary).140root. Also, see the Lighty docs for more information on `FastCGI and Python141<http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_ (note that142explicitly passing a socket to run() is no longer necessary).143144Configuring nginx145-----------------146
5 unmodified lines
152 location = /yourapplication { rewrite ^ /yourapplication/ last; }153 location /yourapplication { try_files $uri @yourapplication; }154 location @yourapplication {155 include fastcgi_params;154 fastcgi_split_path_info ^(/yourapplication)(.*)$;156 fastcgi_split_path_info ^(/yourapplication)(.*)$;157 fastcgi_param PATH_INFO $fastcgi_path_info;158 fastcgi_param SCRIPT_NAME $fastcgi_script_name;159 fastcgi_pass unix:/tmp/yourapplication-fcgi.sock;160 }
54 unmodified lines
215216.. _nginx: http://nginx.org/217.. _lighttpd: http://www.lighttpd.net/218.. _cherokee: http://www.cherokee-project.com/217.. _flup: http://trac.saddi.com/flup219.. _flup: http://trac.saddi.com/flup