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

gru*_*czy 3 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/
Run Code Online (Sandbox Code Playgroud)

我试图访问路径http://hg.internal/enigma-reports/.任何想法,我可能做错了什么?

我在网站中的配置可用如下所示:

<VirtualHost *>
        ServerName hg.internal
        ScriptAlias / "/home/hg/webdir/index.cgi/"
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

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

Ry4*_*ase 5

你的ScriptAlias路线可能是错的 - 错过了一个尾部斜线.

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

所以,当你的URL进来时:

http://hg.internal/enigma-reports/
Run Code Online (Sandbox Code Playgroud)

和apache lops的协议和主机它变成:

/enigma-reports/
Run Code Online (Sandbox Code Playgroud)

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

/home/hg/webdir/index.cgienigma-reports/
Run Code Online (Sandbox Code Playgroud)

这不是一个有效的脚本.

但是,如果新的斜杠到位,则替换为:

/home/hg/webdir/index.cgi/enigma-reports/
Run Code Online (Sandbox Code Playgroud)

果然engigma-reports/PATH_INFOCGI变量,这是剧本看什么.