首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >对于实现FastCGI++库的守护进程,正确的Lighttpd配置是什么?

对于实现FastCGI++库的守护进程,正确的Lighttpd配置是什么?
EN

Stack Overflow用户
提问于 2017-01-26 19:45:00
回答 1查看 568关注 0票数 0

(也发布到FastCGI++-用户邮件列表,但它在很长一段时间内不活跃)

我目前正在尝试在我正在编写的应用程序中使用FastCGI++ (2.1版)库。该应用程序将在linux机器上作为守护进程运行,并通过lighttpd提供状态网页。我打算使用FastCGI++接口定期自动更新状态网页。

我首先在我的应用程序中添加了一个线程,该线程创建FastCGI++管理器的一个实例,并在响应任何请求时回显一个字符串文字(本质上与Hello World示例相同)。

但是,我似乎无法在浏览器中访问它,我怀疑我错误地配置了lighttpd fastcgi模块(下面包含了/etc/lighttpd/lighttpd.conf)。lighttpd错误日志记录了“unix: /tmp/Myapp.sock上没有这样的文件或目录”。

将lighttpd配置为与实现fastcgi++库的守护进程交互的正确方式是什么?是否有必要使用spawn-fcgi启动守护进程?

谢谢,

麦克

cat /etc/lighttpd/lighttpd.conf:

代码语言:javascript
复制
server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
    "mod_redirect",
        "mod_rewrite",
    "mod_cgi",
    "mod_fastcgi",
)

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

cgi.assign = (".py" => "/usr/bin/python3")
fastcgi.debug = 1
fastcgi.server = ( "/device" => (( 
                    "socket" => "/tmp/Myapp.sock",
                    "check_local" => "disable",
                    "docroot" => "/"
                ))
        )

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
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"
EN

回答 1

Stack Overflow用户

发布于 2017-01-26 23:26:55

“unix上没有这样的文件或目录: /tmp/Myapp.sock”

这意味着套接字丢失了。

你的守护进程正在运行吗?是你启动的吗?

如果你想让lighttpd启动守护进程,那么你必须在你的"/device“的fastcgi.server设置中包含"bin-path”。请参阅https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41872748

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档