mercurial - hgweb : repositories are displayed, 但无法访问

标签 mercurial

我正在尝试发布 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/。知道我可能做错了什么吗?

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

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

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

最佳答案

您的 ScriptAlias 行可能有误——缺少尾部斜杠。

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

因此当您的 URL 出现时:

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

协议(protocol)和主机的 apache lops 变成了:

/enigma-reports/

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

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

这不是一个有效的脚本。

但是,使用新的斜线替换为:

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

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

关于mercurial - hgweb : repositories are displayed, 但无法访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4863884/

相关文章:

apache - 访问远程 Mercurial 服务器时,我只打印了 hgweb.cgi python 脚本

version-control - 使用 Mercurial 记录两个文件之间的代码转换

Mercurial/hg - 中止 : outstanding uncommitted merges

linux - 如何在不使用 "yum"命令的情况下在我的 Red Hat Linux 机器上安装 Mercurial?

version-control - 来自外部存储库的 Mercurial "vendor branches"?

mercurial - 在 Debian Squeeze : hg gives an "couldn' t find mercurial libraries"error 上安装 Mercurial

Mercurial .hgrc 通知钩子(Hook)

git - 如何巧妙地限制团队成员的源代码访问?

eclipse - 将 Eclipse 中的项目置于源代码控制之下

search - 如何搜索历史 Mercurial 文件内容?