I have tried to host a Mercurial HG repository using a Scriptalias.

ScriptAlias /hg/ "htdocs/hgwebdir.cgi"

If I go to Chrome it display the contents of the cgi file. In IE it does render however images and links are not displayed. In either case the repository I want to display is not shown.

Has anyone managed to get this working with VisualSVN? Also will this work if I have windows authentication and https?


I have trying to figure this out for two days now!! Wish I had an answer.

Written by ranomore

You must use an absolute path for the last argument of ScriptAlias.

Written by Graham Dumpleton

Accepted Answer

Here's a alternative setup using mod_wsgi (fast!), combined repository directory, and you can manage Mercurial repository level access from the VisualSVN Server GUI.

Download mod_wsgi.so for Apache 2.2 Win32 and place in "C:\Program Files\VisualSVN Server\bin".

Copy hgwebdir.wsgi from your Mercurial installation (contrib directory) to "C:\Program Files\VisualSVN Server\". It should look something like this:

import sys
sys.path.insert(0, "C:\Program Files\Mercurial\library")
from mercurial.hgweb.hgwebdir_mod import hgwebdir
application = hgwebdir('hgweb.config')

Create the config file "C:\Program Files\VisualSVN Server\hgweb.config".

/ = c:/Repositories/*

Paste the following in "C:\Program Files\VisualSVN Server\conf\httpd-custom.conf". You should adjust the Auth* values based on the section of httpd.conf.

LoadModule wsgi_module bin/mod_wsgi.so
WSGIScriptAlias /hg "hgwebdir.wsgi"

<Location /hg/>
    AuthName "Mercurial Repositories"
    AuthType VisualSVN
    AuthzVisualSVNAccessFile "C:/Repositories/authz-windows"
    AuthnVisualSVNBasic on
    AuthnVisualSVNIntegrated off
    AuthnVisualSVNUPN Off

    SVNParentPath "C:/Repositories/"

    require valid-user

Create a Mercurial repository:

hg init C:\Repositories\hgtest

You should now be able to access /hg through your browser, and manage repository level authorization through the VisualSVN Server tool.

Written by h0tw1r3
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki