通过 http 进行 Mercurial 克隆时,出现 500 错误
我在另一台计算机上设置了一个存储库,我想通过 http 开始克隆该存储库。我使用如下所述的指令设置了 apache,并且在目录中我有 Mercurial 提供的 index.cgi 文件。如果存储库是空的,我可以很好地克隆它,但如果它包含文件,我会收到 500 错误。查看错误日志,我看到以下内容:
脚本中的格式错误的标头。发现 Bad header=1 变更集:index.cgi
对我来说,这听起来像是一个权限问题,但所有内容都是 775(我们位于多个防火墙后面),并且所有内容都可以通过浏览器从 index.cgi 访问。
我别无选择,我还缺少什么吗?
阿帕奇配置:
Alias /hg /base/src/hg_cgi
<Directory "/base/src/hg_cgi">
DirectoryIndex index.cgi
AddHandler cgi-script .cgi
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
I set up a repository on another computer for which I want to start cloning over http. I set up apache with the directive as stated below, and in the directory I have my index.cgi file as provided by mercurial. I can clone a repository just fine if it's empty, but if it contains files, I get a 500 error. Looking at the error logs, I see the following:
malformed header from script. Bad header=1 changesets found: index.cgi
To me, this sounds like a permissions issue, but everything is 775 (we're behind several firewalls) and everything is accessable from index.cgi over a browser.
I'm out of options, is there anything I'm missing?
Apache config:
Alias /hg /base/src/hg_cgi
<Directory "/base/src/hg_cgi">
DirectoryIndex index.cgi
AddHandler cgi-script .cgi
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我正在使用 ScriptAlias,将 hgweb.cgi 重命名为 index.cgi,没有打开详细信息,但仍然看到 500 内部服务器错误。
随着
我进入 Apache
I am using ScriptAlias, renamed hgweb.cgi to index.cgi, do not have verbose turned on but still see the 500 Internal server error.
With
I get in Apache
我有同样的错误。
事实证明,注释掉 ~/.hgrc 中的以下行
可以解决问题。
来源:https://www.mercurial-scm.org/bts/issue1250
I had the same error.
Turns out that commenting out the following line in ~/.hgrc
fixed things.
Source: https://www.mercurial-scm.org/bts/issue1250
尝试将“别名”更改为“ScriptAlias”
另外,请检查您的 apache 错误日志。将会有更多更好的产出。
Try changing that 'Alias' to a 'ScriptAlias'
Also, check your apache error log. It will have more and better output.