hgweb:显示存储库,但无法访问
我正在尝试发布 hg 存储库。我正在将 hg 1.7.3
和 hgweb
用于多个存储库。在索引页面上显示存储库名称,但是当我单击它们时,我会获取有关损坏链接的信息。 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 ScriptAlias 行可能是错误的 - 缺少尾部斜杠。
这是必需的,因为 ScriptAlias 会用第一部分替换第二部分。
因此,当您的 URL 输入为:
协议和主机的 apache lops 时,它会变为:
然后 ScriptAlias 匹配第一个
/
并进行替换,在更新之前添加斜杠会产生不是一个有效的脚本。
但是,使用新斜杠后,替换为:
将 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:
and apache lops of protocol and host it becomes:
and then ScriptAlias matches the first
/
and does the replacement, which before your update to add that slash yieldswhich isn't a valid script.
However with your new slash in place the substitution is:
Which turns
engigma-reports/
in to thePATH_INFO
CGI variable, which is what the script looks at.