hgweb.cgi 和 nginx - “连接被拒绝”

发布于 2025-01-06 04:55:37 字数 840 浏览 0 评论 0原文

我已关注 https://www.mercurial-scm.org/wiki/HgWebDirStepByStep 让“hgserve”在 CGI 上运行 - 但它不太有效。

以下是我用来生成 CGI 的命令:

spawn-fcgi -a 127.0.0.1 -p 9000 -f /path/to/hgweb.cgi -P /tmp/fcgi.pid 2>&1

输出表明进程已成功生成,但 ps -p 显示该进程已关闭。果然,当我使用 -n 运行上述命令时,它会输出大量 HTML(存储库列表),然后退出。它不是要留下来监听端口 9000 吗?

Telnetting 到端口 9000 给出“连接被拒绝”,这似乎也是 nginx 也遇到的问题:

2012/02/15 22:16:20 [error] 13483#0: *13 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: emily, request: "GET /hg/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8001"

我确信我的 nginx 配置是正确的,尽管如果您需要查看,我可以将其发布在这里。

感谢您的帮助:)

I've followed https://www.mercurial-scm.org/wiki/HgWebDirStepByStep to get "hg serve" running over CGI - but it's not quite working.

Here is the command I'm using to spawn the CGI:

spawn-fcgi -a 127.0.0.1 -p 9000 -f /path/to/hgweb.cgi -P /tmp/fcgi.pid 2>&1

The output suggests that the process spawned successfully, but a ps -p reveals that the process has already closed down. Sure enough, when I run the above command with -n, it spits out a load of HTML (the list of repositories) and then quits. Isn't it meant to stick around, listening on port 9000?

Telnetting to port 9000 gives "Connection refused" and this appears to be the problem nginx is having also:

2012/02/15 22:16:20 [error] 13483#0: *13 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: emily, request: "GET /hg/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8001"

I'm confident my nginx config is correct, although I can post it here if you need to take a look.

Thanks for any help :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文