gpt4 book ai didi

python - "mod_fcgid: error reading data from FastCGI server"用于直接运行时有效的简单 fcgi 脚本

转载 作者:太空宇宙 更新时间:2023-11-04 11:05:28 25 4
gpt4 key购买 nike

我有以下 fcgi 脚本:

#! /usr/bin/python
import subprocess, sys, os
command=["sudo", "-u", "matt", "/home/matt/cgi-bin/peercoin-abe", str(os.getpid())]
subprocess.Popen(command, stdin=sys.stdin).wait()

peercoin-abe 包含:

#! /bin/sh PYTHONUNBUFFERED=1 exec python /home/matt/peercoin-explorer/Peercoin-Abe/abe.py \
--config /home/matt/abe-peercoin.conf --static-path static/ --watch-pid="$1" >> /home/matt/abe-peercoin.log

但是当我尝试访问它时,我在错误日志中得到了错误:

[Fri Aug 22 22:07:08 2014] [warn] [client 149.254.181.200] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Fri Aug 22 22:07:08 2014] [error] [client 149.254.181.200] Premature end of script headers: peercoin-abe.fcgi

我设置了 FcgidIOTimeout 40FcgidBusyTimeout 3600。 peercoin-abe.fcgi 是可执行文件,由 root 拥有。 peercoin-abe 是可执行的,由 matt 所有。

所以您希望输出到 abe-peercoin.log,但没有。直接运行 peercoin-abe.fcgi 会按预期输出到 abe-peercoin.log。

最佳答案

Fcgi 对此不是很明确,但问题是由于 web 用户的权限无法作为 matt 执行。将此添加到 sudoers 文件是必要的:

www-data ALL=(matt) NOPASSWD: /home/matt/cgi-bin/peercoin-abe

关于python - "mod_fcgid: error reading data from FastCGI server"用于直接运行时有效的简单 fcgi 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25455605/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com