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

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Tags:  Apache Mercurial
codeBeamer 6.0.3 and higher have build in Smart HTTP support thus no apache installation is required any more. Accessing Mercurial via Apache is deprecated and not supported.

Configuring Smart HTTP for Mercurial on Windows

To be able to use Smart HTTP on windows you have to execute the folliowing steps:

  • install Python

  • download the Mercurial module from here

  • install the Mercurial module to the same directory where you installed python
  • in general.xml configure the python executable location. If you installed python to c:\python26then you have to add this line to the config file:
      <hg python-exec="c:\Python26\python.exe"></hg>

Configuring Apache for Mercurial

Accessing Mercurial Repositories via Apache has a couple of advantages:

  • no setup is required for an extra port for external access
  • no SSH key setup is required.

This page describes how to setup Apache to serve Mercurial repositories.

codeBeamer must be installed and started before this configuration can be used.


Please choose the 32 bit version of all software mentioned below even if you are running 64 bits Windows We strongly recommended using the same versions shown on this page.

This description assumes that codeBeamer has been installed into

C:\Dokumente und Einstellungen\zk\Eigene Dateien\CB
  • Download Apache 2.2.17 from the location below or from a mirror:
  • Install Apache to the default location (
    C:\Programme\Apache Software Foundation
    ) and take Typical Installation.
  • Download Python from the location below
  • Install Python into
  • Download the Mercurial runtime from the location below. Note that this will not install a complete Mercurial client.
  • Install Mercurial into the same location where Python is installed (
  • Download Apache mod_wsgi module from the location below:
  • Copy into Apache modules directory
    copy "C:\Programme\Apache Software Foundation\Apache2.2\modules\"
The name of the output file must be!
  • Edit Apache Configuration
Click on Start->Alle Programme->Apache HTTP Server 2.2->Configure Apache Server->Edit the Apache httpd.conf Configuration File!

Append the lines of

C:\Dokumente und Einstellungen\zk\Eigene Dateien\CB\repository\scmweb\httpd.conf.hg
to the end of Apache httpd.conf.

The variable WSGIPythonPath must contain the Python installation directory.

WSGIPythonPath "C:/Programme/Python-2.6.6"
  • Test Apache Configuration
Click on Start->Programme->Apache HTTP Server 2.2->Configure Apache Server->Test Configuration
  • Restarting Apache
Click on Start->Programme->Apache HTTP Server 2.2->Configure Apache Server->Control Apache Server->Restart


It is important that codeBeamer operating system user and apache belong to the same GID!


CodeBeamer requires Mercurial 1.8.5 (or newer).

This description assumes that codeBeamer has been installed into /home/codebeamer/CB.

  • Install Apache HTTP Server using the following command:
    sudo apt-get install apache2
  • Install Mercurial using the command below
    sudo apt-get install mercurial

    Caution: On Ubuntu releases older than 12.04 this may install an obsolete Mercurial version. In this case, you have to manually find and install a newer supported version, e.g:
    sudo add-apt-repository ppa:mercurial-ppa/releases
    sudo apt-get update
    sudo apt-get install mercurial
    hg --version
  • Finally install the
    apache module:
    sudo apt-get install libapache2-mod-wsgi
    and execute this command
    sudo ln -s /etc/apache2/mods-available/wsgi.load /etc/apache2/mods-enabled/wsgi.load
  • Copy httpd.conf.hg
    sudo cp /home/codebeamer/CB/repository/scmweb/httpd.conf.hg /etc/apache2/mods-available/hg.conf
  • Edit
    and replace
    with the path to the library containing the Python libraries. For example:
    WSGIPythonPath /usr/lib/pymodules/python2.6
  • Enable hg support
    sudo ln -s /etc/apache2/mods-available/hg.conf /etc/apache2/mods-enabled/hg.conf

After these steps test the apache configuration with the following command:

sudo apache2ctl configtest

If the command runs without errors then the configuration's OK. You can restart apache:

sudo /etc/init.d/apache2 restart


CodeBeamer requires Mercurial 1.8.5 (or newer).

This description assumes that codeBeamer has been installed into

  • Install the required software components using the following command:
    sudo yum install httpd python mercurial mod_wsgi

    This will install Apache HTTP Server, Python, Mercurial and the
    Caution: All RedHat releases (at least until RHEL 6.2) contain an obsolete Mercurial version.
    hg --version
    In this case, you have to manually find and install a newer supported version, e.g. from
  • Copy the file
  • Now edit
    and replace
    with the path to the library containing the Python libraries. For example:
    WSGIPythonPath /usr/lib64/python2.6:/usr/lib/python2.6
  • Finally test your configuration:
    sudo apachectl configtest
and if everything's fine restart Apache
sudo /etc/init.d/httpd restart

Add codeBeamer user to Apache group (gid)

If apache and codeBeamer operating system users are different (can be checked using
command) apache and codeBeamer operating system users must belong to the same system group (gid).

Typically the name of the apache group is

on Ubuntu and
on Redhat (check your /etc/group).

We suggest to add the codeBeamer user to the apache group.

The example below shows that codeBeamer user id is 1002 and it belongs to gid 33 used by apache:

$ id
uid=1002(codebeamer) gid=33(www-data) groups=33(www-data),111(admin)

Example: Clone a codeBeamer Repository and Commit with an Associated Issue

  • Create a new codeBeamer project with a Managed Mercurial Repository and the name of the repository should be hgtest. Follow the steps described in Creating Managed Repositories.
  • Create a new issue in the Bugs tracker of the new project. This example assumes that the new issue gets the ID 1000 and the project was created by the account bond which has the password 007.
  • On Linux/Unix hg must be in your
    . In Windows add Mercurial to the
    with the command below:
    set PATH="C:\Dokumente und Einstellungen\zk\Eigene Dateien\CB\libexec\hg";%PATH%
  • Cloning the Repository
    hg clone http://bond:007@localhost/hg/hgtest
  • Adding a New File to the Repository
    cd hgtest
    echo hello > readme.txt
    hg add readme.txt
  • Committing (with a codeBeamer Issue) and Pushing Changes into the Upstream Repository
    hg commit -u bond -m "#1000 just a commit"
    hg push
  • Now after refreshing the browser window with issue details and the change set should appear under SCM Commits tab.

MercurialEclipse Plugin can be also used to work with Managed Mercurial Repositories.

Hints ant tips

Solving HTTP Error 413: Request Entity Too Large errors

If you receive an error like this - which can happen if you have lots of heads or branches in Mercurial:

hg pull --verbose
pulling from https://<url.of.mercurial.repo>
searching for changes
abort: HTTP Error 413: Request Entity Too Large

The fix is to increase the HTTP request sizes from the default 16 Kbytes to 64kbytes.

For this edit the following files, both in Apache configuration and also in codeBeamer's tomcat installation:




#LimitRequestFieldSize 12392
LimitRequestFieldSize 65536
#LimitRequestLine 12392
LimitRequestLine 65536

and $CB_HOME/tomcat/conf/server.xml

<Connector port="8009"
            ... etc...

For more details see: