Setup Mercurial Server in Windows Machine - Tutorials are outdated

前端 未结 3 2062
既然无缘
既然无缘 2020-12-23 08:32

I am refering to HgWebDirStepByStep, and trying to setup it in Windows machine (Windows 7).

  1. I can no longer download hgwebdir.cgi from http://www.mercurial-scm
3条回答
  •  被撕碎了的回忆
    2020-12-23 09:23

    By collecting information bits and bytes from every corners, I would like to summary the steps to setup mercurial server using Apache, with authentication feature.


    I install mercurial-1.9.1.win-amd64-py2.6.exe


    Add the following content to 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"
    
      Options ExecCGI FollowSymLinks
      AuthType Basic
      AuthName "AuthName for Mercurial"
      AuthUserFile "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/hg/passwd.txt"
      
          require valid-user
      
    
    

    Create the following 4 files

    C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\hg\hgwebdir.cgi (Download from http://makinggames.ca/wp-content/uploads/2010/05/hgwebdir.txt and rename it to hgwebdir.cgi)

    C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\hg\hgweb.config with the following content.

    [paths]
    dummy1 = d:/mercurial-repo/dummy1
    dummy2 = d:/mercurial-repo/dummy2
    

    c:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\hg\passwd.txt (Refer to this guide http://sniptools.com/vault/windows-apache-and-htaccess-authentication)

    c:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\hg.htaccess (Just leave the file empty)


    Initialize repositories in

    D:\mercurial-repo\dummy0
    D:\mercurial-repo\dummy1
    

    This can be done using TortoiseHg, by applying "Create Repository Here", through right click on folder D:\mercurial-repo\dummy0 and D:\mercurial-repo\dummy1


    Access the mercurial through http://your-server:81/hg/

提交回复
热议问题