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
Provenance
- Commit
fb01187- Tree
c10466f- Author
Ron DuPlain <ron.duplain@gmail.com>- Committer
Ron DuPlain <ron.duplain@gmail.com>- Parent
34380b9
1 file changed+16 added−14 removed
modified:docs/deploying/fastcgi.rst+16 added-14 removed
52 unmodified lines53 54 Configuring Apache55 ------------------56 57-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::57+The example above is good enough for a basic Apache deployment but your `.fcgi`58+file will appear in your application URL59+e.g. example.com/yourapplication.fcgi/news/. There are few ways to configure60+your application so that yourapplication.fcgi does not appear in the URL. A61+preferable way is to use the ScriptAlias configuration directive::62 63 <VirtualHost *>64 ServerName example.com65 ScriptAlias / /path/to/yourapplication.fcgi/66 </VirtualHost>67 64-Another way is to use a custom WSGI middleware. For example on a shared web hosting::68+If you cannot set ScriptAlias, for example on an shared web host, you can use69+WSGI middleware to remove yourapplication.fcgi from the URLs. Set .htaccess::70 66- .htaccess67-71 <IfModule mod_fcgid.c>72 AddHandler fcgid-script .fcgi73 <Files ~ (\.fcgi)>74 SetHandler fcgid-script8 unmodified lines83 RewriteCond %{REQUEST_FILENAME} !-f84 RewriteRule ^(.*)$ yourapplication.fcgi/$1 [QSA,L]85 </IfModule>86 84- yourapplication.fcgi87+Set yourapplication.fcgi::88 89 #!/usr/bin/python90 #: optional path to your local python site-packages folder91 import sys38 unmodified lines130 url.rewrite-once = (131 "^(/static.*)$" => "$1",132 "^(/.*)$" => "/yourapplication.fcgi$1"133 131-Remember to enable the FastCGI, alias and rewrite modules. This132-configuration binds the application to `/yourapplication`. If you want133-the application to work in the URL root you have to work around a134-lighttpd bug with the134+Remember to enable the FastCGI, alias and rewrite modules. This configuration135+binds the application to `/yourapplication`. If you want the application to136+work in the URL root you have to work around a lighttpd bug with the137 :class:`~werkzeug.contrib.fixers.LighttpdCGIRootFix` middleware.138 139 Make sure to apply it only if you are mounting the application the URL138-root. Also, see the Lighty docs for more information on `FastCGI and139-Python <http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_140-(note that explicitly passing a socket to run() is no longer necessary).140+root. Also, see the Lighty docs for more information on `FastCGI and Python141+<http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModFastCGI>`_ (note that142+explicitly passing a socket to run() is no longer necessary).143 144 Configuring nginx145 -----------------146 5 unmodified lines152 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 lines215 216 .. _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