I think Apache is a great way of sharing hg repositories. Not only does the hgweb.wsgi script give one the possibility of running multiple repositories, but it allows developers to conveniently cross-reference the project source code by path or revision from a definitive source.
The following procedure will give an easy way of publishing a repository, and making it available over an https web connection to authenticated users.
First of all I suggest making a clone of your repo without a local file directory.
hg clone -U <myproject> <myproject_to_serve>
Next (using the WSGI configuration which is nice an easy), do the following:
Move your repo to a convenient place from which to serve it:
mv <myproject_to_serve> /var/www/hg/<myproject_to_serve>
Make sure that the repo is read/writable by the web server user:
chown -R www-data:www-data /var/www/hg/<myproject_to_serve>
Now setup read/write rights for users of the project, and provide some information for the project listing on your server's home page:
description = 'This is my new web-enabled project <myproject>'
contact = email@example.com
# consider limiting push usage to only a subset of users
allow_push = *
Now setup WSGI
/myproj = /var/www/hg/my_project_to_serve
Now setup apache
CustomLog /var/www/mydomain/logs/hg_access_log common
# path to provided hgweb.wsgi script
WSGIScriptAlias / /var/www/hg/scripts/hgweb.wsgi
<Location / >
The above requires you to have:
- The hgweb.wsgi script (which comes with a standard Mercurial install on, say, Debian) somewhere conveniently available
- An AuthUserFile in apache htdigest format for creating authenticated users.
hg.mydomain.net will show you a nicely formatted list of available projects.
hg.mydomain.net/myproj will show you, after successful authentication, the current status of your project as per the