【问题标题】:Setting up mercurial web interface on nearlyfreespeech在 Nearfreespeech 上设置 mercurial Web 界面
【发布时间】:2013-06-16 09:13:58
【问题描述】:

我最近一直在努力设置我的虚拟主机以用于 mercurial repos 和 hgweb。我使用nearlyfreespeech.net (NFSN) 进行托管。

默认情况下,NFSN 有一个 freebsd72 的 CGI 领域,并限制你只能使用 CGI,没有 WGSI 或类似的。最初,NFSN 安装了 mercurial 1.6,但通过松散地遵循these 说明,我能够获得 mercurial 2.6 设置。 Python 2.6.6 也默认安装在主机上,我保持原样。

我现在的问题是我无法在浏览器中加载 hgweb.cgi 文件。当我在主机上通过 SSH 运行它时,它运行良好并输出 HTML,但在我的浏览器中出现 500 内部服务器错误。该文件是可执行的并且启用了 CGI。我不确定还有什么要检查的......有人对在 NFSN 上使用 hg 和 hgweb 有任何建议或经验吗?

根据评论中的建议,我检查了创建的错误日志,发现当我访问该站点时,我得到...

[Sun Jun 16 08:22:31 2013] [error] [client 172.17.0.141] CGI ERROR: A system problem prevented your request from being completed.
[Sun Jun 16 08:22:31 2013] [error] [client 172.17.0.141] Premature end of script headers: hgweb.cgi

对该错误进行一些搜索后发现,这意味着脚本在运行时可能未生成正确的标头。如果我将脚本的输出保存到文件中,我会得到以下内容...

Status: 200 Script output follows
Content-Type: text/html; charset=US-ASCII

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<link rel="icon" href="/static/hgicon.png" type="image/png" />
<meta name="robots" content="index, nofollow" />
<link rel="stylesheet" href="/static/style-paper.css" type="text/css" />

<title>Mercurial repositories index</title>
</head>
<body>

<div class="container">
<div class="menu">
<a href="http://mercurial.selenic.com/">
<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
</div>
<div class="main">
<h2>Mercurial Repositories</h2>

<table class="bigtable">
    <tr>
        <th><a href="?sort=name">Name</a></th>
        <th><a href="?sort=description">Description</a></th>
        <th><a href="?sort=contact">Contact</a></th>
        <th><a href="?sort=lastchange">Last modified</a></th>
        <th>&nbsp;</th>
    </tr>

</table>
</div>
</div>

</body>
</html>

【问题讨论】:

  • 某处的 Web 服务器日志中应该有错误。您是否通过 Apache 运行 CGI?尝试查看错误日志。
  • @djc 我更新了我的帖子以包含日志输出。除了将配置路径更改为我网站的本地目录之外,我没有更改任何默认脚本

标签: web mercurial dvcs hgweb nearlyfreespeech


【解决方案1】:

我发现hgweb.cgi脚本实际上需要设置为755权限,设置为可执行是不够的。

【讨论】:

    猜你喜欢
    • 2011-04-06
    • 1970-01-01
    • 1970-01-01
    • 2011-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多