我正在引用HgWebDirStepByStep,并试图在Windows机器(Windows 7)中设置它.
hgwebdir.cgi内容sys.path.insert(0, "c:/dev/Mercurial/lib"),但我没有在我最新的Mercurial安装中找到任何文件夹.我只能看到它上面有一个zip文件.似乎教程的信息已经过时了.我有什么好的指南在Windows机器上设置Mercurial服务器?由于服务器中已有Apache,我想使用Apache而不是IIS.
Che*_*eng 10
通过从每个角落收集信息位和字节,我想总结使用Apache设置mercurial服务器的步骤,以及身份验证功能.
我安装了mercurial-1.9.1.win-amd64-py2.6.exe
将以下内容添加到C:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\conf\httpd.conf
# Some comment so that you can find these settings later
ScriptAliasMatch ^/hg(.*) "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/hg/hgwebdir.cgi$1"
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/hg">
Options ExecCGI FollowSymLinks
AuthType Basic
AuthName "AuthName for Mercurial"
AuthUserFile "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/hg/passwd.txt"
<Limit GET POST>
require valid-user
</Limit>
</Directory>
Run Code Online (Sandbox Code Playgroud)
创建以下4个文件
C:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\htdocs\hg\hgwebdir.cgi(从http://makinggames.ca/wp-content/uploads/2010/05/hgwebdir.txt下载并重命名它到hgwebdir.cgi)
C:\ Program Files文件(x86)的\ Apache软件基金会\ APACHE2.2\htdocs中\汞柱\ hgweb.config具有以下内容.
[paths]
dummy1 = d:/mercurial-repo/dummy1
dummy2 = d:/mercurial-repo/dummy2
Run Code Online (Sandbox Code Playgroud)
c:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\htdocs\hg\passwd.txt(请参阅本指南http://sniptools.com/vault/windows-apache-and-htaccess-authentication)
c:\ Program Files(x86)\ Apache Software Foundation\Apache2.2\htdocs\hg.htaccess(只需将文件保留为空)
初始化存储库
D:\mercurial-repo\dummy0
D:\mercurial-repo\dummy1
Run Code Online (Sandbox Code Playgroud)
这可以使用TortoiseHg,通过右键单击文件夹D:\ mercurial-repo\dummy0和D:\ mercurial-repo\dummy1,在此处应用"Create Repository Here"来完成
通过访问mercurial http://your-server:81/hg/
| 归档时间: |
|
| 查看次数: |
9689 次 |
| 最近记录: |