You are not logged in. Click here to log in.

codeBeamer ALM

Search In Project

Search inClear

Tags:  not added yet

Configuring Mercurial for Microsoft IIS

Accessing Mercurial Repositories via Microsoft IIS has a couple of advantages:

  • IIS is shipped with most Windows distributions so it doesn't require extra installation
  • no setup is required for an extra port for external access
  • no SSH key setup is required.

This page describes how to setup Microsoft IIS to serve Mercurial repositories.

This guide was created for Windows Server 2003. However, the steps are very similar for other windows releases.

codeBeamer must be installed and started before this configuration can be used. IIS doesn't support file based authentication (like
for apache) so the authentication must be done through LDAP

Installing Mercurial and Python

Please choose the 32 bit version of all software mentioned below even if you are running 64 bits Windows

If IIS is not enabled go to Control Panel, select Add/Remove Programs, click on Add/Remove Windows Components and check Application Server.

Download and install Python 2.6.6 using this URL:
as installation directory.

Download the Mercurial runtime from the location below. Note that this will not install a complete Mercurial client.

Install the runtime to the same directory where Python was installed (


Download and install PyWin (also to

: PyWin).

Download and install the ISAPI wsgi handler:

Clone the Mercurial repository to a temporary location. You can use the mercurial executable shipped with mercurial:

CBHOME\libexec\hg\hg.exe clone
(in the command change
to the installation directory of codebeamer).

Navigate to the directory, where you cloned the Mercurial repo to. Copy

. Now edit this line starting wiht
and change the path like this:
hgweb_config = r'CBHOME\repository\scmweb\hgweb_apache.config'

From command line, navigate to

and execute the following command:

This will generate

that IIS will use.

Configuring IIS for Mercurial

Start IIS manager: Start > Administrative Tools > Internet Information Services (IIS) Manager

First you have to create a new Application Pool called Mercurial. To achieve this right click on Application pools and select Add new application pool. In the popup type Mercurial as name and click ok.

Then create a new web site:

  • in the left tree right click on Web Sites and from the popup menu choose New > Web Site:

  • follow the steps of the wizard

(at this point make sure that you choose a port that is not in use)

Now the web site is created. Right click on it ad choose Properies. Click the Home Directory tab and set the Application Pool to Mercurial:

Switch to the Directory Security tab, click on Edit in the Authentication and access control. DIsbale anonymus access and enable basic authentication. This makes you able to access repositories using users configured on the server.

Now you have to create a new handler mapping:

  • right click on the new Mercurial webpage in the left tree
  • click Properties in the context menu
  • click on the Home Directory tab
  • click on the Configure button then choose the Mappings tab
  • click on Insert and in the Executable field set the
    that was created previously
  • uncheck the Verify that file exists
  • click OK, then click Apply

The last (and most important) step is adding a new web service extension.

  • right click on Web Service Extensions in the left tree and click Add a new Web Service Extentsion.
  • type Mercurial WSGI shim as name and click on Add
  • on the next window browse the previously created
    and make sure to check the Set extension status to allowed checkbox

Finally restart IIS. Now you can browse your mercurial repositories using this url:

is the port number you specified when creating the Mercurial webpage.