如何在 IIS 上设置 Mercurial 和 hgweb? [英] How do I set up Mercurial and hgweb on IIS?

查看:25
本文介绍了如何在 IIS 上设置 Mercurial 和 hgweb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找有关如何让 hgweb 在 IIS 上工作的体面说明,但我没有找到太多价值.

I've been looking all over for decent instructions on how to get hgweb working on IIS but I haven't found much of worth.

Mercurial wiki 上有这个循序渐进",但不是非常好.还有 this这个,但同样,我找不到好的步骤来引导直到那些开始的地方.

There's this "step by step" on the Mercurial wiki, but it's not very good. There's also this and this, but again, I can't find good steps to lead up to where those get started.

推荐答案

我昨天刚安装了一个新的 Mercurial 实例,这里是 1.7 的更新说明:

I just had to install a fresh Mercurial instance yesterday, here's updated instructions for 1.7:

  1. 安装 Mercurial(这些说明已使用 1.7 进行了测试)
  2. 安装 Python(对于 Mercurial 1.7,您必须使用 x86Python 2.6.6 版本)
  3. 您需要从 Mercurial 源下载 hgweb.cgi 文件.您可以通过运行以下命令下载源代码:hg clone https://www.mercurial-scm.org/repo/hg/
  4. 创建一个文件夹,作为您的 Web 应用程序文件夹.您需要将三件事复制到此文件夹中:

  1. Install Mercurial (these instructions were tested with 1.7)
  2. Install Python (for Mercurial 1.7, you must use the x86 version of Python 2.6.6)
  3. You will need to download the hgweb.cgi file from the Mercurial source. You can download the source by running: hg clone https://www.mercurial-scm.org/repo/hg/
  4. Create a folder that will be your web application folder. You will need to copy three things into this folder:

  • hgweb.cgi 文件
  • C:Program FilesMercurial"文件夹中 Library.zip 的内容
  • C:Program FilesMercurial"中的 Templates 文件夹

您需要确保在 IIS 中设置了 Python.

You will need to make sure you have Python set up in IIS.

  • 通过以下方式启用 CGI:控制面板 -> 打开或关闭 Windows 功能 -> 角色 -> Web 服务器 (IIS) -> 添加角色服务 -> 检查 CGI
  • 在 IIS 中创建一个新网站并确保物理路径是您在上面创建的文件夹
  • 在新网站的处理程序映射中,选择添加脚本映射".输入 *.cgi 作为请求路径,c:Python26python.exe -u "%s" 作为可执行文件,Python为名称.
  • Enable CGI via the following: Control Panel -> Turn Windows Features On or Off -> Roles -> Web Server (IIS) -> Add Role Services -> Check CGI
  • Create a new Web Site in IIS and make sure the physical path is the folder you created above
  • In the Handler Mappings for the new website, select "Add Script Map". Enter *.cgi for the request path, c:Python26python.exe -u "%s" for the Executable, and Python for the Name.

您还需要创建一个名为hgweb.config"的文件,其内容类似于以下内容.文件中的路径必须是您要在其中存储 Mercurial 存储库的驱动器位置:

You will also need to create a file named "hgweb.config" with contents similar to below. The path within the file needs to be the location on your drive where you want to store the Mercurial repositories:

[收藏]
c:Mercurial epos = c:Mercurial epos

[collections]
c:Mercurial epos = c:Mercurial epos

编辑 hgweb.cgi 文件并将设置 hgweb.config 路径的行更改为如下所示(无论 hgweb.config 文件在哪里):

Edit the hgweb.cgi file and change the line where it sets the path to your hgweb.config to something like the following (wherever the hgweb.config file is):

config = "C:Mercurialhgweb.config"

config = "C:Mercurialhgweb.config"

此外,请查看 Jeremy Skinners 博文.它有点过时,但有一些额外的好步骤,例如为更干净的 URL 设置 URL 重写.

Also, check out Jeremy Skinners blog post . It's a little outdated, but has some extra nice steps like setting up URL re-writing for cleaner URL's.

这篇关于如何在 IIS 上设置 Mercurial 和 hgweb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆