|
|
|
@ -79,7 +79,7 @@ handle all incoming requests::
|
|
|
|
|
</Location> |
|
|
|
|
</VirtualHost> |
|
|
|
|
|
|
|
|
|
These processes will be managed by Apache. If you're using an standalone |
|
|
|
|
These processes will be managed by Apache. If you're using a standalone |
|
|
|
|
FastCGI server, you can use the FastCgiExternalServer directive instead. |
|
|
|
|
Note that in the following the path is not real, it's simply used as an |
|
|
|
|
identifier to other |
|
|
|
@ -87,7 +87,7 @@ directives such as AliasMatch::
|
|
|
|
|
|
|
|
|
|
FastCgiServer /var/www/html/yourapplication -host 127.0.0.1:3000 |
|
|
|
|
|
|
|
|
|
If you cannot set ScriptAlias, for example on an shared web host, you can use |
|
|
|
|
If you cannot set ScriptAlias, for example on a shared web host, you can use |
|
|
|
|
WSGI middleware to remove yourapplication.fcgi from the URLs. Set .htaccess:: |
|
|
|
|
|
|
|
|
|
<IfModule mod_fcgid.c> |
|
|
|
@ -168,7 +168,7 @@ Configuring nginx
|
|
|
|
|
Installing FastCGI applications on nginx is a bit different because by |
|
|
|
|
default no FastCGI parameters are forwarded. |
|
|
|
|
|
|
|
|
|
A basic flask FastCGI configuration for nginx looks like this:: |
|
|
|
|
A basic Flask FastCGI configuration for nginx looks like this:: |
|
|
|
|
|
|
|
|
|
location = /yourapplication { rewrite ^ /yourapplication/ last; } |
|
|
|
|
location /yourapplication { try_files $uri @yourapplication; } |
|
|
|
@ -195,7 +195,7 @@ have to figure out how to calculate `PATH_INFO` and `SCRIPT_NAME`::
|
|
|
|
|
Running FastCGI Processes |
|
|
|
|
------------------------- |
|
|
|
|
|
|
|
|
|
Since Nginx and others do not load FastCGI apps, you have to do it by |
|
|
|
|
Since nginx and others do not load FastCGI apps, you have to do it by |
|
|
|
|
yourself. `Supervisor can manage FastCGI processes. |
|
|
|
|
<http://supervisord.org/configuration.html#fcgi-program-x-section-settings>`_ |
|
|
|
|
You can look around for other FastCGI process managers or write a script |
|
|
|
@ -229,7 +229,7 @@ that your webserver user is `www-data`::
|
|
|
|
|
In this case the error seems to be "yourapplication" not being on the |
|
|
|
|
python path. Common problems are: |
|
|
|
|
|
|
|
|
|
- Relative paths being used. Don't rely on the current working directory |
|
|
|
|
- Relative paths being used. Don't rely on the current working directory. |
|
|
|
|
- The code depending on environment variables that are not set by the |
|
|
|
|
web server. |
|
|
|
|
- Different python interpreters being used. |
|
|
|
|