hgwebdir not following symlinks

paul.boddie at biotek.uio.no paul.boddie at biotek.uio.no
Thu Apr 15 12:49:29 CDT 2010

Johannes Totz wrote:
> I'm having trouble with hgwebdir and symlinks: when generating the index
> page (with all the repos available) it doesn't list any symlinked repos.
> Trying to access a symlinked repo directly via URL gets my an error
> message. Might be related to nesting repos...
> E.g.
> 1) https://server/hg/repo works
> 2) https://server/hg/symlinkedrepo works
> 3) https://server/hg/repo/symlinkedrepo does not (output is for repo
> instead)
> 4) https://server/hg/repo/symlinkeddir/repo2 does not (title of page is
> for repo, content says "An error occurred while processing your
> request: 00manifest.i at repo2: no match found")

It would be interesting to know how Apache is configured for hgwebdir and
what your hgweb.config file contains. Certainly, a correctly configured
hgwebdir serving content under https://server/hg/ should be able to
provide both kinds of repositories. (I've just tested this, in fact.)

> 5) https://server/hg/repo/dir/symlinkedrepo does not (lists repos in
> repo/dir/)
> 6) https://server/hg/repo/nestedrepo works
> This is running Apache2 with hg version 1.5, and hgwebdir works fine
> otherwise. Apache's FollowSymLinks option is on, and looking at the
> code of walkrepos in util.py this should work (my Python skills are
> pretty bad though).
> Any ideas how to debug this?

The mention of FollowSymLinks makes me wonder whether your repositories
are situated under the document root (or equivalent) of the Web server.
With hgwebdir, only the hgwebdir.cgi script needs to reside in a location
known to the Web server - you are not actually meant to be publishing the
repository directories directly (as static files) with Apache.

Two parts of the Wiki documentation are pertinent:

Firstly, setting up the hgweb.config file - I imagine that using
collections of repositories is most convenient in this situation:


Secondly, setting up the Apache configuration. Here, only the hgwebdir.cgi
script needs to be known to Apache - only the script itself needs to know
about where the repositories are:


Apologies if you're doing the right thing already here, but I'm rather
suspicious of Web server configuration and the numerous side-effects that
can make people believe that a problem resides in one place when really
it's the Web server being "helpful".


More information about the Mercurial mailing list