hgweb:显示存储库,但无法访问

发布于 2024-10-15 15:21:33 字数 658 浏览 1 评论 0原文

我正在尝试发布 hg 存储库。我正在将 hg 1.7.3hgweb 用于多个存储库。在索引页面上显示存储库名称,但是当我单击它们时,我会获取有关损坏链接的信息。 Apache 错误日志显示:

[Tue Feb 01 15:41:31 2011] [error] [client 10.13.3.64] script not found or unable to stat: /home/hg/webdir/index.cgienigma-reports, referer: http://hg.internal/

我试图访问路径 http://hg.internal/enigma-reports/。知道吗,我可能做错了什么?

我在 site-available 中的配置如下所示:

<VirtualHost *>
        ServerName hg.internal
        ScriptAlias / "/home/hg/webdir/index.cgi/"
</VirtualHost>

之前,index.cgi 的路径中没有尾部斜杠。为什么需要尾部斜杠?现在它看起来像一个目录,而不是一个文件,并且看起来非常违反直觉。

I am trying to publish hg repository. I am using hg 1.7.3 and hgweb for multiple repositories. On the index page repository names are displayed, but when I click on them, I get information about broken link. Apache error log says:

[Tue Feb 01 15:41:31 2011] [error] [client 10.13.3.64] script not found or unable to stat: /home/hg/webdir/index.cgienigma-reports, referer: http://hg.internal/

I was trying to access path http://hg.internal/enigma-reports/. Any idea, what I might have done wrong?

My config in sites-available looks like this:

<VirtualHost *>
        ServerName hg.internal
        ScriptAlias / "/home/hg/webdir/index.cgi/"
</VirtualHost>

Before there was no trailing slash in the path to index.cgi. Why the trailing slash is required? Now it looks like a directory, rather than a file and seems very counter-intuitive.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妖妓 2024-10-22 15:21:33

您的 ScriptAlias 行可能是错误的 - 缺少尾部斜杠。

这是必需的,因为 ScriptAlias 会用第一部分替换第二部分。

因此,当您的 URL 输入为:

http://hg.internal/enigma-reports/

协议和主机的 apache lops 时,它会变为:

/enigma-reports/

然后 ScriptAlias 匹配第一个 / 并进行替换,在更新之前添加斜杠会产生

/home/hg/webdir/index.cgienigma-reports/

不是一个有效的脚本。

但是,使用新斜杠后,替换为:

/home/hg/webdir/index.cgi/enigma-reports/

将 engigma-reports/ 转换为 PATH_INFO CGI 变量,这就是脚本所查看的内容。

Your ScriptAlias line is probably wrong -- missing a trailing slash.

This is required because ScriptAlias does a substitution of the first part for the second part.

So when your URL comes in as:

http://hg.internal/enigma-reports/

and apache lops of protocol and host it becomes:

/enigma-reports/

and then ScriptAlias matches the first / and does the replacement, which before your update to add that slash yields

/home/hg/webdir/index.cgienigma-reports/

which isn't a valid script.

However with your new slash in place the substitution is:

/home/hg/webdir/index.cgi/enigma-reports/

Which turns engigma-reports/ in to the PATH_INFO CGI variable, which is what the script looks at.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文