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

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

问题描述

我一直在寻找有关如何使hgwebdir在IIS上正常工作的不错的指导,但是我没有发现太多的价值.

I've been looking all over for decent instructions on how to get hgwebdir 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,您必须使用x86版本的Python 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 Files \ Mercurial"文件夹中Library.zip的内容
  • "C:\ Program Files \ Mercurial"中的Templates文件夹

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

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

  • 通过以下方式启用CGI:控制面板"->打开或关闭Windows功能"->角色"->"Web服务器(IIS)"->添加角色服务"->检查CGI"
  • 在IIS中创建一个新网站,并确保物理路径是您在上面创建的文件夹
  • 在新网站的处理程序映射中,选择添加脚本映射".输入 *.cgi 作为请求路径,输入 c:\ Python26 \ python.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:\Python26\python.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 \ repos = c:\ Mercurial \ repos

[collections]
c:\Mercurial\repos = c:\Mercurial\repos

编辑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:\ Mercurial \ hgweb.config"

config = "C:\Mercurial\hgweb.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和hgwebdir?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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