没有 CGI 的 Mercurial hgweb 在 IIS 6.0 中无法工作

发布于 2024-11-25 05:32:18 字数 1818 浏览 0 评论 0原文

我正在尝试按照这两个链接使用 ISAPI 让 Mercurial hgweb 工作 http://blog.jaredreisinger.com吸血鬼基础。服务器是 IIS 6.0 Windows Server 2003。

一年前,在同一台计算机上,我使用 TortoiseHG 1.0 的 CGI 成功运行了 Mercurial hgweb 作为实验,但由于某些原因,当我尝试添加 TortoiseHG 1.9+ 项目时,存储库网站将损坏了,并且似乎 .hg 目录对于 1.0 和 1.9+ 具有完全不同的文件结构,我认为最简单的方法是创建新的存储库和 Web 目录。

因此,这次在寻找更多有关设置 Mercurial 的更新信息后,我决定采用 ISAPI 路由而不是 CGI,因为它似乎更易于设置并且运行速度更快(这对我来说并不重要)。

但在一步步遵循这两篇文章后,我总是在 Chrome 中收到错误消息:“系统找不到输入的环境选项。”每次重新启动 IIS 后,如果刷新页面,消息将更改为“未指定错误”。

如果我在 IE 中查看此页面,错误消息将是“网站无法显示页面 HTTP 500”。

在这两种情况下,错误消息都不是很有帮助,我真的不知道可能是什么问题。不知道有什么方法可以获得更详细的日志/调试信息?否则,如果没有足够的信息,任何人都很难帮助我。

对于我的 hgwebdir_wsgi.py 我只更改了这一行:

# Configuration file location
hgweb_config = r'c:\Inetpub\HgWeb\hgweb.config'

对于我的 hgweb.config 我使用的是最小配置

[paths]
/ = I:\CompanyName\Development\SVCProjects\*

我正在使用 Python 2.6.6、PyWin32 2.16 for Python 2.6、Mercurial 1.9 for Windows for Py2.6 和 ISAPI_WSGI for Windows 0.42 。

编辑: 查看 IIS 日志,我得到以下几行:

2011-07-19 03:42:51 W3SVC1 127.0.0.1 GET /hg/hgwebdir.cgi - 443 pstar 127.0.0.1 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/534.30+(KHTML,+like+Gecko)+Chrome/12.0.742.122+Safari/534.30 500 0 203 333 435

2011-07-19 03:42:51 W3SVC1 127.0.0.1 GET /favicon.ico - 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/534.30+(KHTML,+like+Gecko)+Chrome/12.0.742.122+Safari/534.30 404 0 2 1830 358

所以看起来像IIS 仍在尝试使用我已删除的 hgwebdir.cgi,不知道如何解决该问题。

I am trying to get Mercurial hgweb working using ISAPI following those two links http://blog.jaredreisinger.com and Vampire Basic. The server is a IIS 6.0 Windows server 2003.

On the same machine I had successfully got Mercurial hgweb running using CGI for TortoiseHG 1.0 as a experiment a year ago, but for some reasons when I tried to add TortoiseHG 1.9+ projects the repository website will broken, and seems like the .hg directory had quite different file structures for 1.0 and 1.9+, I think the simplest way is create new repository and web directory.

So this time after looking for more updated information for setting up Mercurial, I decided to take ISAPI route instead of CGI as it seems easier to setup and should be faster to run (not that it matter much for me).

But after following both articles step by step I always end up with error message in Chrome: "The system could not find the environment option that was entered." every first time after I restarted IIS, and then the message will changed to "Unspecified error" if I refresh the page.

If I view this page in IE, the error message will be "The website cannot display the page HTTP 500".

In both cases the error message are not very helpful and I really don't have any clue about what could be the problem. Don't know is there any way I could get more detailed log/debug information? Otherwise without enough information it would be hard for anyone trying to help me as well.

For my hgwebdir_wsgi.py I only changed this line:

# Configuration file location
hgweb_config = r'c:\Inetpub\HgWeb\hgweb.config'

and for my hgweb.config I am using the minimum config

[paths]
/ = I:\CompanyName\Development\SVCProjects\*

I am using Python 2.6.6, PyWin32 2.16 for Python 2.6, Mercurial 1.9 for Windows for Py2.6 and ISAPI_WSGI for Windows 0.42.

Edit:
Looking at the IIS log, I got following lines:

2011-07-19 03:42:51 W3SVC1 127.0.0.1 GET /hg/hgwebdir.cgi - 443 pstar
127.0.0.1 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/534.30+(KHTML,+like+Gecko)+Chrome/12.0.742.122+Safari/534.30 500 0 203 333 435

2011-07-19 03:42:51 W3SVC1 127.0.0.1 GET /favicon.ico - 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+5.2)+AppleWebKit/534.30+(KHTML,+like+Gecko)+Chrome/12.0.742.122+Safari/534.30 404 0 2 1830 358

So looks like IIS is still trying to use hgwebdir.cgi which I already removed, don't know how to fix that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏尔 2024-12-02 05:32:18

我通过使用“python -m win32traceutil”找出原因(从 hgwebdir_wsgi.py 源代码注释中得到这个)。基本上它无法加载模块“hgwebdir_wsgi”。原因是 Mercurial Python 模块 1.9 没有使用 win32 安装程序正确安装。我尝试了这里的方法另一个SO问题解决方案除了我没有复制 MFC71.dll,这对我不起作用。最后我找到了这个链接issue2582,并遵循临时解决方案,下载 Mercurial Python win32 安装程序的非官方版本它有效。

I find out the reason by using "python -m win32traceutil" (got this from hgwebdir_wsgi.py source code comments). Basically it failed to load module 'hgwebdir_wsgi'. The reason is Mercurial Python module 1.9 was not installed properly using win32 installer. I tried method from here another SO question solution except I didn't copy MFC71.dll, and that does not work for me. Finally I found this link issue2582, and following the temporary solution by downloading an unofficial build of Mercurial Python win32 installer and it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文