我已经安装了lighttp和python,我正在尝试运行python项目,但在启动lighttp守护进程时遇到fastcgi错误。这个项目在旧服务器上运行愉快,但还不喜欢新服务器。配置文件与旧的工作服务器相同。
2015-02-25 07:59:01: (log.c.166) server started
2015-02-25 07:59:01: (mod_fastcgi.c.1366) --- fastcgi spawning local
proc: /srv/http/main.py
port: 0
socket /tmp/fastcgi.socket
max-procs: 1
2015-02-25 07:59:01: (mod_fastcgi.c.1390) --- fastcgi spawning
port: 0
socket /tmp/fastcgi.socket
current: 0 / 1
2015-02-25 07:59:01: (mod_fastcgi.c.1103) the fastcgi-backend /srv/http/main.py failed to start:
2015-02-25 07:59:01: (mod_fastcgi.c.1107) child exited with status 1 /srv/http/main.py
2015-02-25 07:59:01: (mod_fastcgi.c.1110) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2015-02-25 07:59:01: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2015-02-25 07:59:01: (server.c.1021) Configuration of plugins failed. Going down.
lighttpd.conf文件的相关部分如下所示。
server.modules += ("mod_fastcgi")
fastcgi.server = (
"/main.py" => ((
"socket" => "/tmp/fastcgi.socket",
"bin-path" => "/srv/http/main.py",
"max-procs" => 1,
"bin-environment" => (
"REAL_SCRIPT_NAME" => "",
"POSTGRES_USER" => "postgres",
),
"check-local" => "disable"
)),
)
fastcgi.debug = 1
lighttpd可以访问/ tmp文件夹,当lighttpd运行时,它会创建/tmp/fastcgi.socket文件。