(也发布到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:
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"发布于 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
https://stackoverflow.com/questions/41872748
复制相似问题