Required installation files:
- Xampp-win32-1.8.3-4-vc11-installer.exe
- Python-2.7.7.amd64.msi
- Tortoisehg-3.0.1-x64.msi
- Mercurial-3.0.1.win-amd64-py2.7.exe
- Mercurial-3.0.1-x64.msi
- Server-jre-8u5-windows-x64.tar.gz
1. Use TORTOISEHG to build a repository: Under D: Create Hg folder, make D:\HG, right click, select Tortoisehg | Create Repository here.
2. Create a folder under C:\xampp\htdocs, Hgweb
3. Create the hgweb.cgi file in C:\xampp\htdocs\hgweb, as follows (the latest content can be found http://www.selenic.com/hg/file/tip/hgweb.cgi):
- Change the first line to point to the Python.exe position
#! C:/python26/python.exe
- Remove the comment from line tenth
IMPORTCGITB; cgitb.enable ()
- Note for line sixth: # Path to repo or Hgweb config to serve (see ' HG help Hgweb '), which means that the config variable can point to the repository or to a configuration file. Start with a simple point, point to the warehouse, and change line seventh to
Config= "D:/HG"
- Install Mercurial-3.0.1.win-amd64-py2.7.exe, display installed in C:\Program files\lib\site-packages, will
Importsys; Sys.path.insert (0, "C:/xampp/mlib")
Switch
Importsys;
- Modify the Apache configuration file http.conf, add a line at the end
SCRIPTALIAS/HG "c:/xampp/htdocs/hgweb/hgweb.cgi"
- However, you can access only one library, you want to access multiple libraries, you need to use the Hgweb.config file, hgweb.cgi config variable is assigned to Hgweb.config
- The contents of the Hgweb.config file are
[collections] d:/hg= d:/hg [web] allow_push= false Allow_pull= false allow_read= false Push_ssl= false style = Gitweb
- Create a user password file with Htpasswd.exe. Htpasswd.exe can be found in the Apache Bin directory, using methods mainly
- HTPASSWD-C file name username//parameter-C Create password file, input will prompt you to enter the password
- HTPASSWD file name username//Update password if user name is the same
For instance, I'm going to build two users now.
Htpasswd-c hguser fatkun.com htpasswd hguser AAAA
You will get a hguser file and copy it to the Conf directory.
- At the end of the httpd.conf configuration, add
<Location/hg> AuthType Basic "mercurialrepositories" authuserfile"d:/javasofttool/xampplite/apache/ Conf/hguser " Require valid-user </Location>
In addition to extracting server-jre-8u5-windows-x64.tar.gz files, plus java_home, path and other environment variables xampp in the Tomcat will not start, you need to the registry hkey_local_machine\ Software\javasoft\javaRuntime environment\ Add
Javahome REG_SZ C:\JAVA
Reference files:
Build mercurial web versioning service using Apache in Windows
Mercurial (HG) version Control service user name verification
Apache build Mercurial (HG) version control services and permissions control
JDK and JRE in the Java Configuration environment