@Quad_Tree

Почему не работает fastcgi на lighttpd?

Написал веб-приложение на Python и создал для него вот такой вот скрипт:

#!/usr/bin/python3
from flup.server.fcgi import WSGIServer
import app

if __name__ == '__main__':
        WSGIServer(app).run()


Потом настроил lighttpd веб-сервер:
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" )

url.rewrite-once = (
    "^(/static($|/.*))$" => "$1",
    "^(/.*)$" => "/application.fcgi$1"
)

# default listening port for IPv6 falls back to the IPv4 port
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"

server.modules += ( "mod_cgi" )
cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".cgi" => "/usr/bin/perl",
                               ".rb"  => "/usr/bin/ruby",
                               ".erb" => "/usr/bin/eruby",
                               ".py"  => "/usr/bin/python",
                               ".php" => "/usr/bin/php-cgi" )

server.modules += ( "mod_fastcgi" )
fastcgi.server = (
	"/application.fcgi" =>
	((
		"socket" => "/tmp/application-fcgi.sock",
		"bin-path" => "/var/www/html/controlpanel/application.fcgi",
		"check-local" => "disable",
		"max-procs" => 1
	))
)


Но при запуске lighttpd начинает выкидывать в лог вот такие ошибки:
2018-02-25 15:49:01: (log.c.217) server started 
2018-02-25 15:49:01: (mod_fastcgi.c.1159) the fastcgi-backend /var/www/html/controlpanel/application.fcgi failed to start: 
2018-02-25 15:49:01: (mod_fastcgi.c.1163) child exited with status 1 /var/www/html/controlpanel/application.fcgi 
2018-02-25 15:49:01: (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-02-25 15:49:01: (mod_fastcgi.c.1518) [ERROR]: spawning fcgi failed. 
2018-02-25 15:49:01: (server.c.1269) Configuration of plugins failed. Going down.


Я сделал lighty-enable-mod fastcgi, но это тоже особо не помогло.
В чём проблема?
  • Вопрос задан
  • 1256 просмотров
Пригласить эксперта
Ответы на вопрос 1
delvin-fil
@delvin-fil
Crazy Linux-admin
При такой настройке вроде работает.
s_1519574954_6281129_4cbf345d06.png
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы