I'm trying to run a small program in python:
import os
from flup.server.fcgi import WSGIServer
from webapi import webapi
from configuration import config
from setup import setup
if __name__ == "__main__":
setup()
if config.getboolean("server", "wsgi_container"):
WSGIServer(webapi, debug=config.getboolean("server", "debug")).run()
else:
webapi.run(config.get("server", "host"),
port=config.getint("server", "webport"),
threaded=True)
and the log gives this:
2018-07-16 20:22:56: (log.c.217) server started
2018-07-16 20:22:56: (mod_fastcgi.c.1485) --- fastcgi spawning local \n\tproc: /home/juancasa/Workspace/webapi_blueprint/run.py \n\tport: 0 \n\tsocket /tmp/webapi_blueprint.socket \n\tmax-procs: 1
2018-07-16 20:22:56: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /tmp/webapi_blueprint.socket \n\tcurrent: 0 / 1
2018-07-16 20:22:56: (mod_fastcgi.c.1159) the fastcgi-backend /home/juancasa/Workspace/webapi_blueprint/run.py failed to start:
2018-07-16 20:22:56: (mod_fastcgi.c.1163) child exited with status 8 /home/juancasa/Workspace/webapi_blueprint/run.py
2018-07-16 20:22:56: (mod_fastcgi.c.1166) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.\nIf this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2018-07-16 20:22:56: (mod_fastcgi.c.1518) [ERROR]: spawning fcgi failed.
2018-07-16 20:22:56: (server.c.1269) Configuration of plugins failed. Going down.
The configuration of the lighttpd.conf is:
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
)
server.document-root = "/var/www/html/"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
# default listening port for IPv6 falls back to the IPv4 port
## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
And the fast cgi is:
server.modules += ( "mod_fastcgi" )
fastcgi.debug = 1
fastcgi.server = ("/" => (
"webapi_blueprint" => (
"bin-path" => "/home/juancasa/Workspace/webapi_blueprint/run.py",
"socket" => "/tmp/webapi_blueprint.socket",
"check-local" => "disable",
"max-procs" => 1
)
)
)
You see that you are trying to execute it but it does not arrive and the python log is empty. First I thought it would be the permissions but the file I indicated is the following:
-rwxrwxr-x 1 juancasa juancasa 458 Jul 14 18:05 run.py
So as you can see it has the permissions to execute.
Any ideas of what may be failing or how can I get more information?